Changed FileSystemProvisioner.snapshot to take a glob argument

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@28263 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
abayer committed 2010-03-04 18:30:32 +00:00
1 parent 37886e407e
commit 1f00f6cea0
2 files changed
+20 -3

No files matched your search

@@ -167,8 +167,11 @@ public abstract class FileSystemProvisioner implements ExtensionPoint, Describab
* @param ws
* New workspace should be prepared in this location. This is the same value as
* {@code build.getProject().getWorkspace()} but passed separately for convenience.
* @param glob
* Ant-style file glob for files to include in the snapshot. May not be pertinent for all
* implementations.
*/
public abstract WorkspaceSnapshot snapshot(AbstractBuild<?,?> build, FilePath ws, TaskListener listener) throws IOException, InterruptedException;
public abstract WorkspaceSnapshot snapshot(AbstractBuild<?,?> build, FilePath ws, String glob, TaskListener listener) throws IOException, InterruptedException;
public FileSystemProvisionerDescriptor getDescriptor() {
return (FileSystemProvisionerDescriptor) Hudson.getInstance().getDescriptorOrDie(getClass());
@@ -198,13 +201,20 @@ public abstract class FileSystemProvisioner implements ExtensionPoint, Describab
}
/**
* Creates a tar ball.
* @deprecated as of 1.350
*/
public WorkspaceSnapshot snapshot(AbstractBuild<?, ?> build, FilePath ws, TaskListener listener) throws IOException, InterruptedException {
return snapshot(build, ws, "**/*", listener);
}
/**
* Creates a tar ball.
*/
public WorkspaceSnapshot snapshot(AbstractBuild<?, ?> build, FilePath ws, String glob, TaskListener listener) throws IOException, InterruptedException {
File wss = new File(build.getRootDir(),"workspace.zip");
OutputStream os = new BufferedOutputStream(new FileOutputStream(wss));
try {
ws.zip(os);
ws.zip(os,glob);
} finally {
os.close();
}