ant throws an exception if the base dir doesn't exist.

This breaks some of the error checks in places like ArtifactArchiver or JavadocArchiver, so return 0 instead of IOException.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14704 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-01-22 02:12:31 +00:00
1 parent 2fdcdc8cb4
commit 63a8adbed2
1 file changed
+8 -2
+8 -2
View File
@@ -865,6 +865,7 @@ public final class FilePath implements Serializable {
// local to local copy.
return act(new FileCallable<Integer>() {
public Integer invoke(File base, VirtualChannel channel) throws IOException {
if(!base.exists()) return 0;
assert target.channel==null;
try {
@@ -966,8 +967,13 @@ public final class FilePath implements Serializable {
TarOutputStream tar = new TarOutputStream(new GZIPOutputStream(new BufferedOutputStream(pipe.getOut())));
tar.setLongFileMode(TarOutputStream.LONGFILE_GNU);
DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project());
String[] files = ds.getIncludedFiles();
String[] files;
if(baseDir.exists()) {
DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project());
files = ds.getIncludedFiles();
} else {
files = new String[0];
}
for( String f : files) {
if(Functions.isWindows())
f = f.replace('\\','/');