Browse Source

bugzilla: 42142 add name of missing archive for zipfileset

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@529630 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
f1e9c972fb
2 changed files with 13 additions and 6 deletions
  1. +9
    -4
      src/main/org/apache/tools/ant/taskdefs/Unpack.java
  2. +4
    -2
      src/main/org/apache/tools/ant/types/ArchiveFileSet.java

+ 9
- 4
src/main/org/apache/tools/ant/taskdefs/Unpack.java View File

@@ -83,16 +83,21 @@ public abstract class Unpack extends Task {
*/
public void setSrcResource(Resource src) {
if (!src.isExists()) {
throw new BuildException("the archive doesn't exist");
throw new BuildException(
"the archive " + src.getName() + " doesn't exist");
}
if (src.isDirectory()) {
throw new BuildException("the archive can't be a directory");
throw new BuildException(
"the archive " + src.getName() + " can't be a directory");
}
if (src instanceof FileResource) {
source = ((FileResource) src).getFile();
} else if (!supportsNonFileResources()) {
throw new BuildException("Only FileSystem resources are"
+ " supported.");
throw new BuildException(
"The source " + src.getName()
+ " is not a FileSystem "
+ "Only FileSystem resources are"
+ " supported.");
}
srcResource = src;
}


+ 4
- 2
src/main/org/apache/tools/ant/types/ArchiveFileSet.java View File

@@ -242,10 +242,12 @@ public abstract class ArchiveFileSet extends FileSet {
return super.getDirectoryScanner(p);
}
if (!src.isExists()) {
throw new BuildException("the archive doesn't exist");
throw new BuildException(
"the archive " + src.getName() + " doesn't exist");
}
if (src.isDirectory()) {
throw new BuildException("the archive can't be a directory");
throw new BuildException("the archive " + src.getName()
+ " can't be a directory");
}
ArchiveScanner as = newArchiveScanner();
as.setSrc(src);


Loading…
Cancel
Save