providing possibly confusing error messages to user. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270391 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -95,7 +95,7 @@ public final class DestDir extends ValidatedFileAttribute { | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (f.exists() && !f.isDirectory()) { | if (f.exists() && !f.isDirectory()) { | ||||
| message = "DestDir " + f + " is not a directory."; | |||||
| message = f + " is not a directory."; | |||||
| return false; | return false; | ||||
| } | } | ||||
| //If DestDir does not exist, make sure it is well formed. | //If DestDir does not exist, make sure it is well formed. | ||||
| @@ -105,7 +105,7 @@ public final class DestDir extends ValidatedFileAttribute { | |||||
| File parent = new File(tmp.getParent()); | File parent = new File(tmp.getParent()); | ||||
| if (parent.exists()) { | if (parent.exists()) { | ||||
| if (!parent.isDirectory()) { | if (!parent.isDirectory()) { | ||||
| message = "DestDir " + f + " contains the path " | |||||
| message = f + " contains the path " | |||||
| + parent + " that is not a directory."; | + parent + " that is not a directory."; | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -95,7 +95,7 @@ public final class DestFile extends ValidatedFileAttribute { | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (f.exists() && !f.isFile()) { | if (f.exists() && !f.isFile()) { | ||||
| message = "DestFile " + f + " is not a file."; | |||||
| message = f + " is not a file."; | |||||
| return false; | return false; | ||||
| } | } | ||||
| //If DestFile does not exist, make sure it is well formed. | //If DestFile does not exist, make sure it is well formed. | ||||
| @@ -105,7 +105,7 @@ public final class DestFile extends ValidatedFileAttribute { | |||||
| File parent = new File(tmp.getParent()); | File parent = new File(tmp.getParent()); | ||||
| if (parent.exists()) { | if (parent.exists()) { | ||||
| if (!parent.isDirectory()) { | if (!parent.isDirectory()) { | ||||
| message = "DestFile " + f + " contains the path " | |||||
| message = f + " contains the path " | |||||
| + parent + " that is not a directory."; | + parent + " that is not a directory."; | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -63,21 +63,21 @@ import org.apache.tools.ant.BuildException; | |||||
| * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | ||||
| */ | */ | ||||
| public final class SrcDir extends ValidatedFileAttribute { | public final class SrcDir extends ValidatedFileAttribute { | ||||
| /** | |||||
| /** | |||||
| * empty constructor | * empty constructor | ||||
| */ | */ | ||||
| public SrcDir() {} | public SrcDir() {} | ||||
| /** | |||||
| * file constructor; performs validation | |||||
| /** | |||||
| * file constructor; performs validation | |||||
| * @param file the file to use | * @param file the file to use | ||||
| */ | */ | ||||
| public SrcDir(File file) throws BuildException { | public SrcDir(File file) throws BuildException { | ||||
| setFile(file); | |||||
| setFile(file); | |||||
| } | } | ||||
| private String message; | private String message; | ||||
| protected final String getMessage() { | protected final String getMessage() { | ||||
| @@ -95,11 +95,11 @@ public final class SrcDir extends ValidatedFileAttribute { | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (!f.exists()) { | if (!f.exists()) { | ||||
| message = "SrcDir " + f + " does not exist."; | |||||
| message = f + " does not exist."; | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (!f.isDirectory()) { | if (!f.isDirectory()) { | ||||
| message = "SrcDir " + f + " is not a directory."; | |||||
| message = f + " is not a directory."; | |||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| @@ -64,20 +64,20 @@ import org.apache.tools.ant.BuildException; | |||||
| */ | */ | ||||
| public final class SrcFile extends ValidatedFileAttribute { | public final class SrcFile extends ValidatedFileAttribute { | ||||
| /** | |||||
| /** | |||||
| * empty constructor | * empty constructor | ||||
| */ | */ | ||||
| public SrcFile() {} | public SrcFile() {} | ||||
| /** | |||||
| * file constructor; performs validation | |||||
| /** | |||||
| * file constructor; performs validation | |||||
| * @param file the file to use | * @param file the file to use | ||||
| */ | */ | ||||
| public SrcFile(File file) throws BuildException { | public SrcFile(File file) throws BuildException { | ||||
| setFile(file); | |||||
| setFile(file); | |||||
| } | } | ||||
| private String message; | private String message; | ||||
| protected final String getMessage() { | protected final String getMessage() { | ||||
| @@ -95,11 +95,11 @@ public final class SrcFile extends ValidatedFileAttribute { | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (!f.exists()) { | if (!f.exists()) { | ||||
| message = "SrcFile " + f + " does not exist."; | |||||
| message = f + " does not exist."; | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (!f.isFile()) { | if (!f.isFile()) { | ||||
| message = "SrcFile " + f + " is not a file."; | |||||
| message = f + " is not a file."; | |||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||