hudson.Util.createTempDir()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(241)

本文整理了Java中hudson.Util.createTempDir()方法的一些代码示例,展示了Util.createTempDir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.createTempDir()方法的具体详情如下:
包路径:hudson.Util
类名称:Util
方法名:createTempDir

Util.createTempDir介绍

[英]Creates a new temporary directory.
[中]创建一个新的临时目录。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. File tmpDir = Util.createTempDir();

代码示例来源:origin: jenkinsci/jenkins

  1. File dir = Util.createTempDir();
  2. hudson.setMountPoint(dir);
  3. hudson.mount();

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-harness

  1. private TestPluginManager() throws IOException {
  2. // TestPluginManager outlives a Jetty server, so can't pass in ServletContext.
  3. super(null, Util.createTempDir());
  4. }

代码示例来源:origin: org.eclipse.hudson/hudson-test-framework

  1. private TestPluginManager() throws IOException {
  2. // TestPluginManager outlives a Jetty server, so can't pass in ServletContext.
  3. super(null, Util.createTempDir());
  4. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-framework

  1. private TestPluginManager() throws IOException {
  2. // TestPluginManager outlives a Jetty server, so can't pass in ServletContext.
  3. super(null, Util.createTempDir());
  4. }

代码示例来源:origin: jenkinsci/jenkins-test-harness

  1. public TestPluginManager() throws IOException {
  2. // TestPluginManager outlives a Jetty server, so can't pass in ServletContext.
  3. super(null, Util.createTempDir());
  4. }

代码示例来源:origin: jenkinsci/git-client-plugin

  1. /**
  2. * Creates a empty dummy {@link Repository} to keep JGit happy where it wants a valid {@link Repository} operation
  3. * for remote objects.
  4. */
  5. private Repository openDummyRepository() throws IOException {
  6. final File tempDir = Util.createTempDir();
  7. return new FileRepository(tempDir) {
  8. @Override
  9. public void close() {
  10. super.close();
  11. try {
  12. Util.deleteRecursive(tempDir);
  13. } catch (IOException e) {
  14. // ignore
  15. }
  16. }
  17. };
  18. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. File tmpDir = Util.createTempDir();

代码示例来源:origin: jenkinsci/docker-slaves-plugin

  1. @Override
  2. public String getImage(DockerDriver driver, FilePath workspace, TaskListener listener) throws IOException, InterruptedException {
  3. if (image != null) return image;
  4. String tag = Long.toHexString(System.nanoTime());
  5. final FilePath pathToContext = workspace.child(contextPath);
  6. if (!pathToContext.exists()) {
  7. throw new IOException(pathToContext.getRemote() + " does not exists.");
  8. }
  9. final FilePath pathToDockerfile = pathToContext.child(dockerfile);
  10. if (!pathToDockerfile.exists()) {
  11. throw new IOException( pathToContext.getRemote() + " does not exists.");
  12. }
  13. final File context = Util.createTempDir();
  14. pathToContext.copyRecursiveTo(new FilePath(context));
  15. pathToDockerfile.copyTo(new FilePath(new File(context, "Dockerfile")));
  16. driver.buildDockerfile(listener, context.getAbsolutePath(), tag, forcePull);
  17. Util.deleteRecursive(context);
  18. this.image = tag;
  19. return tag;
  20. }

代码示例来源:origin: io.jenkins.plugins/docker-slaves

  1. @Override
  2. public String getImage(DockerDriver driver, FilePath workspace, TaskListener listener) throws IOException, InterruptedException {
  3. boolean pull = forcePull;
  4. if (image != null) return image;
  5. String tag = Long.toHexString(System.nanoTime());
  6. final FilePath pathToContext = workspace.child(contextPath);
  7. if (!pathToContext.exists()) {
  8. throw new IOException(pathToContext.getRemote() + " does not exists.");
  9. }
  10. final FilePath pathToDockerfile = pathToContext.child(dockerfile);
  11. if (!pathToDockerfile.exists()) {
  12. throw new IOException( pathToContext.getRemote() + " does not exists.");
  13. }
  14. final File context = Util.createTempDir();
  15. pathToContext.copyRecursiveTo(new FilePath(context));
  16. pathToDockerfile.copyTo(new FilePath(new File(context, "Dockerfile")));
  17. driver.buildDockerfile(listener, context.getAbsolutePath(), tag, pull);
  18. Util.deleteRecursive(context);
  19. this.image = tag;
  20. return tag;
  21. }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. File tmpDir = Util.createTempDir();

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. File tmpDir = Util.createTempDir();

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. File dir = Util.createTempDir();
  2. hudson.setMountPoint(dir);
  3. hudson.mount();

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. File dir = Util.createTempDir();
  2. hudson.setMountPoint(dir);
  3. hudson.mount();

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. File dir = Util.createTempDir();
  2. hudson.setMountPoint(dir);
  3. hudson.mount();

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. File dir = Util.createTempDir();
  2. hudson.setMountPoint(dir);
  3. hudson.mount();

代码示例来源:origin: hudson/hudson-2.x

  1. File dir = Util.createTempDir();
  2. hudson.setMountPoint(dir);
  3. hudson.mount();

代码示例来源:origin: org.hudsonci.plugins/cvs

  1. File destdir = null;
  2. try {
  3. destdir = Util.createTempDir();

代码示例来源:origin: org.jvnet.hudson.plugins/cvs

  1. File destdir = null;
  2. try {
  3. destdir = Util.createTempDir();

代码示例来源:origin: achikin/testrail-jenkins-plugin

  1. FilePath tempdir = new FilePath(Util.createTempDir());

相关文章