/** * 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); }
/** * 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); }
/** * 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); }
@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); }
/** * 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); }
/** * 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); }
/** * {@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); }
/** * 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); }
/** * 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); }
/** * {@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); }
/** * { * * @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); }
/** * {@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); }
/** * 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); }
@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, "**/*"); }
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 } }
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 } }
@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); }
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; }
@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")); } } }
@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(); }