hudson.FilePath.copyRecursiveTo()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(222)

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

FilePath.copyRecursiveTo介绍

[英]Copies the contents of this directory recursively into the specified target directory.
[中]将此目录的内容递归复制到指定的目标目录中。

代码示例

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

/**
 * Copies the contents of this directory recursively into the specified target directory.
 * 
 * @return
 *      the number of files copied.
 * @since 1.312 
 */
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo("**/*",target);
}

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

/**
 * Copies the files that match the given file mask to the specified target node.
 *
 * @param fileMask
 *      Ant GLOB pattern.
 *      String like "foo/bar/*.xml" Multiple patterns can be separated
 *      by ',', and whitespace can surround ',' (so that you can write
 *      "abc, def" and "abc,def" to mean the same thing.
 * @return
 *      the number of files copied.
 */
public int copyRecursiveTo(String fileMask, FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo(fileMask,null,target);
}

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

/**
 * Copies the files that match the given file mask to the specified target node.
 *
 * @param fileMask
 *      Ant GLOB pattern.
 *      String like "foo/bar/*.xml" Multiple patterns can be separated
 *      by ',', and whitespace can surround ',' (so that you can write
 *      "abc, def" and "abc,def" to mean the same thing.
 * @param excludes
 *      Files to be excluded. Can be null.
 * @return
 *      the number of files copied.
 */
public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo(new DirScanner.Glob(fileMask, excludes), target, fileMask);
}

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

@Override public void archive(FilePath workspace, Launcher launcher, BuildListener listener, final Map<String,String> artifacts) throws IOException, InterruptedException {
  File dir = getArtifactsDir();
  String description = "transfer of " + artifacts.size() + " files"; // TODO improve when just one file
  workspace.copyRecursiveTo(new FilePath.ExplicitlySpecifiedDirScanner(artifacts), new FilePath(dir), description);
}

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

/**
 * Copies the contents of this directory recursively into the specified target directory.
 * @since 1.312 
 */
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo("**/*",target);
}

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

/**
 * Copies the contents of this directory recursively into the specified target directory.
 * @since 1.312 
 */
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo("**/*",target);
}

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

/**
 * {@see copyRecursiveTo(String fileMask, String excludes, FilePath target, FilePath.TarCompression remoteCompressionType)}
 */
public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target)
  throws IOException, InterruptedException {
  return copyRecursiveTo(fileMask, excludes, target, FilePath.TarCompression.GZIP);
}

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

/**
 * Copies the contents of this directory recursively into the specified target directory.
 * 
 * @return
 *      the number of files copied.
 * @since 1.312 
 */
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo("**/*",target);
}

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

/**
 * Copies the contents of this directory recursively into the specified
 * target directory.
 *
 * @since 1.312
 */
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo("**/*", target);
}

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

/**
 * {@see copyRecursiveTo(String fileMask, String excludes, FilePath target, FilePath.TarCompression remoteCompressionType)}
 */
public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target)
  throws IOException, InterruptedException {
  return copyRecursiveTo(fileMask, excludes, target, FilePath.TarCompression.GZIP);
}

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

/**
 * {
 *
 * @see copyRecursiveTo(String fileMask, String excludes, FilePath target,
 * FilePath.TarCompression remoteCompressionType)}
 */
public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target)
    throws IOException, InterruptedException {
  return copyRecursiveTo(fileMask, excludes, target, FilePath.TarCompression.GZIP);
}

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

/**
 * {@see copyRecursiveTo(String fileMask, String excludes, FilePath target, FilePath.TarCompression remoteCompressionType)}
 */
public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target)
  throws IOException, InterruptedException {
  return copyRecursiveTo(fileMask, excludes, target, FilePath.TarCompression.GZIP);
}

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

/**
 * Copies the contents of this directory recursively into the specified target directory.
 * @since 1.312 
 */
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException {
  return copyRecursiveTo("**/*",target);
}

代码示例来源:origin: io.jenkins.jenkinsfile-runner/payload

@Override
public void checkout(@Nonnull Run<?, ?> build, @Nonnull Launcher launcher, @Nonnull FilePath workspace, @Nonnull TaskListener listener, @CheckForNull File changelogFile, @CheckForNull SCMRevisionState baseline) throws IOException, InterruptedException {
  new FilePath(new File(dir)).copyRecursiveTo(new DirScanner.Glob("**/*", null, false), workspace, "**/*");
}

代码示例来源:origin: jenkinsci/analysis-core-plugin

private void copySourceFilesToModuleBuildFolder(final MavenBuild newBuild) {
  FilePath filePath = new FilePath(new File(newBuild.getRootDir(), AbstractAnnotation.WORKSPACE_FILES));
  try {
    filePath.copyRecursiveTo("*.tmp", new FilePath(new File(getOwner().getRootDir(), AbstractAnnotation.WORKSPACE_FILES)));
  }
  catch (IOException exception) {
    Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Can't copy workspace files: ", exception);
  }
  catch (InterruptedException exception) {
    // ignore, user canceled the operation
  }
}

代码示例来源:origin: org.hudsonci.plugins/analysis-core

private void copySourceFilesToModuleBuildFolder(final MavenBuild newBuild) {
  FilePath filePath = new FilePath(new File(newBuild.getRootDir(), AbstractAnnotation.WORKSPACE_FILES));
  try {
    filePath.copyRecursiveTo("*.tmp", new FilePath(new File(getOwner().getRootDir(), AbstractAnnotation.WORKSPACE_FILES)));
  }
  catch (IOException exception) {
    Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Can't copy workspace files: ", exception);
  }
  catch (InterruptedException exception) {
    // ignore, user canceled the operation
  }
}

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

@Override public void archive(FilePath workspace, Launcher launcher, BuildListener listener, final Map<String,String> artifacts) throws IOException, InterruptedException {
  File dir = getArtifactsDir();
  String description = "transfer of " + artifacts.size() + " files"; // TODO improve when just one file
  workspace.copyRecursiveTo(new FilePath.ExplicitlySpecifiedDirScanner(artifacts), new FilePath(dir), description);
}

代码示例来源:origin: org.jenkins-ci.plugins/cloverphp

private boolean copyHtmlReport(FilePath coverageReportDir, FilePath buildTarget, BuildListener listener)
    throws IOException, InterruptedException {
  // Copy the HTML coverage report
  final FilePath htmlIndexHtmlPath = coverageReportDir.child("index.html");
  if (htmlIndexHtmlPath.exists()) {
    final FilePath htmlDirPath = htmlIndexHtmlPath.getParent();
    listener.getLogger().println("Publishing Clover HTML report...");
    htmlDirPath.copyRecursiveTo("**/*", buildTarget);
    return true;
  }
  return false;
}

代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-cps-global-lib

@Override public void copy(Run<?,?> original, Run<?,?> copy, TaskListener listener) throws IOException, InterruptedException {
  LibrariesAction action = original.getAction(LibrariesAction.class);
  if (action != null) {
    copy.addAction(new LibrariesAction(action.getLibraries()));
    FilePath libs = new FilePath(original.getRootDir()).child("libs");
    if (libs.isDirectory()) {
      libs.copyRecursiveTo(new FilePath(copy.getRootDir()).child("libs"));
    }
  }
}

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

@LocalData
@Test
public void testSlave() throws Exception {
  DumbSlave s = rule.createOnlineSlave();
  project.setAssignedLabel(s.getSelfLabel());
  FilePath src = new FilePath(rule.jenkins.getRootPath(), "jobs/" + BASIC_TEST_PROJECT + "/workspace/");
  assertNotNull(src);
  FilePath dest = s.getWorkspaceFor(project);
  assertNotNull(dest);
  src.copyRecursiveTo("*.xml", dest);
  testBasic();
}

相关文章