git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@694254 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -171,6 +171,7 @@ public class DirectoryScanner | |||||
| }; | }; | ||||
| public static final int MAX_LEVELS_OF_SYMLINKS = 1; | public static final int MAX_LEVELS_OF_SYMLINKS = 1; | ||||
| public static final String DOES_NOT_EXIST_POSTFIX = " does not exist."; | |||||
| /** Helper. */ | /** Helper. */ | ||||
| private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | ||||
| @@ -834,8 +835,9 @@ public class DirectoryScanner | |||||
| } else { | } else { | ||||
| if (!basedir.exists()) { | if (!basedir.exists()) { | ||||
| if (errorOnMissingDir) { | if (errorOnMissingDir) { | ||||
| illegal = new IllegalStateException( | |||||
| "basedir " + basedir + " does not exist."); | |||||
| illegal = new IllegalStateException("basedir " | |||||
| + basedir | |||||
| + DOES_NOT_EXIST_POSTFIX); | |||||
| } else { | } else { | ||||
| // Nothing to do - basedir does not exist | // Nothing to do - basedir does not exist | ||||
| return; | return; | ||||
| @@ -1100,7 +1102,7 @@ public class DirectoryScanner | |||||
| String[] newfiles = list(dir); | String[] newfiles = list(dir); | ||||
| if (newfiles == null) { | if (newfiles == null) { | ||||
| if (!dir.exists()) { | if (!dir.exists()) { | ||||
| throw new BuildException(dir + " doesn't exist."); | |||||
| throw new BuildException(dir + DOES_NOT_EXIST_POSTFIX); | |||||
| } else if (!dir.isDirectory()) { | } else if (!dir.isDirectory()) { | ||||
| throw new BuildException(dir + " is not a directory."); | throw new BuildException(dir + " is not a directory."); | ||||
| } else { | } else { | ||||
| @@ -434,7 +434,8 @@ public class Copy extends Task { | |||||
| ds = fs.getDirectoryScanner(getProject()); | ds = fs.getDirectoryScanner(getProject()); | ||||
| } catch (BuildException e) { | } catch (BuildException e) { | ||||
| if (failonerror | if (failonerror | ||||
| || !getMessage(e).endsWith(" not found.")) { | |||||
| || !getMessage(e).endsWith(DirectoryScanner | |||||
| .DOES_NOT_EXIST_POSTFIX)) { | |||||
| throw e; | throw e; | ||||
| } else { | } else { | ||||
| log("Warning: " + getMessage(e), Project.MSG_ERR); | log("Warning: " + getMessage(e), Project.MSG_ERR); | ||||
| @@ -446,7 +446,8 @@ public abstract class AbstractFileSet extends DataType | |||||
| } | } | ||||
| if (!dir.exists() && errorOnMissingDir) { | if (!dir.exists() && errorOnMissingDir) { | ||||
| throw new BuildException(dir.getAbsolutePath() | throw new BuildException(dir.getAbsolutePath() | ||||
| + " does not exist."); | |||||
| + DirectoryScanner | |||||
| .DOES_NOT_EXIST_POSTFIX); | |||||
| } | } | ||||
| if (!dir.isDirectory() && dir.exists()) { | if (!dir.isDirectory() && dir.exists()) { | ||||
| throw new BuildException(dir.getAbsolutePath() | throw new BuildException(dir.getAbsolutePath() | ||||
| @@ -153,7 +153,7 @@ public class CopyTest extends BuildFileTest { | |||||
| public void testMissingDirBail() { | public void testMissingDirBail() { | ||||
| expectBuildException("testMissingDirBail", "not-there doesn't exist"); | expectBuildException("testMissingDirBail", "not-there doesn't exist"); | ||||
| assertTrue(getBuildException().getMessage().endsWith(" not found.")); | |||||
| assertTrue(getBuildException().getMessage().endsWith(" does not exist.")); | |||||
| } | } | ||||
| public void testFileResourcePlain() { | public void testFileResourcePlain() { | ||||