Browse Source

Switch getParentFile(File) to delegate to File.getParentFile() and deprecate.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276364 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 21 years ago
parent
commit
531e66cb1e
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      src/main/org/apache/tools/ant/Main.java

+ 5
- 6
src/main/org/apache/tools/ant/Main.java View File

@@ -506,20 +506,19 @@ public class Main implements AntMain {
* Helper to get the parent file for a given file.
* <p>
* Added to simulate File.getParentFile() from JDK 1.2.
* @deprecated
*
* @param file File to find parent of. Must not be <code>null</code>.
* @return Parent file or null if none
*/
private File getParentFile(File file) {
String filename = file.getAbsolutePath();
file = new File(filename);
filename = file.getParent();
File parent = file.getParentFile();

if (filename != null && msgOutputLevel >= Project.MSG_VERBOSE) {
System.out.println("Searching in " + filename);
if (parent != null && msgOutputLevel >= Project.MSG_VERBOSE) {
System.out.println("Searching in " + parent.getAbsolutePath());
}

return (filename == null) ? null : new File(filename);
return parent;
}

/**


Loading…
Cancel
Save