git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@417126 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1339,9 +1339,6 @@ public class Project implements ResourceFactory { | |||||
* | * | ||||
* @return the resolved File. | * @return the resolved File. | ||||
* | * | ||||
* @deprecated since 1.7 | |||||
* Use @see {FileUtils#resolveFile FileUtils.resolveFile} | |||||
* instead. | |||||
*/ | */ | ||||
public File resolveFile(String fileName) { | public File resolveFile(String fileName) { | ||||
return FILE_UTILS.resolveFile(baseDir, fileName); | return FILE_UTILS.resolveFile(baseDir, fileName); | ||||
@@ -27,7 +27,6 @@ import org.apache.tools.ant.types.Environment; | |||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.RedirectorElement; | import org.apache.tools.ant.types.RedirectorElement; | ||||
import org.apache.tools.ant.util.FileUtils; | |||||
import org.apache.tools.ant.util.JavaEnvUtils; | import org.apache.tools.ant.util.JavaEnvUtils; | ||||
/** | /** | ||||
@@ -98,8 +97,6 @@ public abstract class AbstractJarSignerTask extends Task { | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
private Path path = null; | private Path path = null; | ||||
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | |||||
/** | /** | ||||
* Set the maximum memory to be used by the jarsigner process | * Set the maximum memory to be used by the jarsigner process | ||||
@@ -290,7 +287,7 @@ public abstract class AbstractJarSignerTask extends Task { | |||||
// is the keystore a file | // is the keystore a file | ||||
addValue(cmd,"-keystore"); | addValue(cmd,"-keystore"); | ||||
String loc; | String loc; | ||||
File keystoreFile = FILE_UTILS.resolveFile(getProject().getBaseDir(), keystore); | |||||
File keystoreFile = getProject().resolveFile(keystore); | |||||
if (keystoreFile.exists()) { | if (keystoreFile.exists()) { | ||||
loc = keystoreFile.getPath(); | loc = keystoreFile.getPath(); | ||||
} else { | } else { | ||||
@@ -412,7 +412,7 @@ public class ExecTask extends Task { | |||||
return exec; | return exec; | ||||
} | } | ||||
// try to find the executable | // try to find the executable | ||||
File executableFile = FILE_UTILS.resolveFile(getProject().getBaseDir(), exec); | |||||
File executableFile = getProject().resolveFile(exec); | |||||
if (executableFile.exists()) { | if (executableFile.exists()) { | ||||
return executableFile.getAbsolutePath(); | return executableFile.getAbsolutePath(); | ||||
} | } | ||||
@@ -111,8 +111,6 @@ public class Javac extends MatchingTask { | |||||
private String source; | private String source; | ||||
private String debugLevel; | private String debugLevel; | ||||
private File tmpDir; | private File tmpDir; | ||||
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | |||||
/** | /** | ||||
* Javac task for compilation of Java files. | * Javac task for compilation of Java files. | ||||
@@ -804,7 +802,7 @@ public class Javac extends MatchingTask { | |||||
// compile lists | // compile lists | ||||
String[] list = src.list(); | String[] list = src.list(); | ||||
for (int i = 0; i < list.length; i++) { | for (int i = 0; i < list.length; i++) { | ||||
File srcDir = FILE_UTILS.resolveFile(getProject().getBaseDir(), list[i]); | |||||
File srcDir = getProject().resolveFile(list[i]); | |||||
if (!srcDir.exists()) { | if (!srcDir.exists()) { | ||||
throw new BuildException("srcdir \"" | throw new BuildException("srcdir \"" | ||||
+ srcDir.getPath() | + srcDir.getPath() | ||||
@@ -543,7 +543,7 @@ public class Javadoc extends Task { | |||||
while (tok.hasMoreTokens()) { | while (tok.hasMoreTokens()) { | ||||
String f = tok.nextToken(); | String f = tok.nextToken(); | ||||
SourceFile sf = new SourceFile(); | SourceFile sf = new SourceFile(); | ||||
sf.setFile(FILE_UTILS.resolveFile(getProject().getBaseDir(),f.trim())); | |||||
sf.setFile(getProject().resolveFile(f.trim())); | |||||
addSource(sf); | addSource(sf); | ||||
} | } | ||||
} | } | ||||
@@ -1016,7 +1016,7 @@ public class Javadoc extends Task { | |||||
if (!tok.hasMoreTokens()) { | if (!tok.hasMoreTokens()) { | ||||
throw new BuildException(linkOfflineError); | throw new BuildException(linkOfflineError); | ||||
} | } | ||||
le.setPackagelistLoc(FILE_UTILS.resolveFile(getProject().getBaseDir(),tok.nextToken())); | |||||
le.setPackagelistLoc(getProject().resolveFile(tok.nextToken())); | |||||
} | } | ||||
/** | /** | ||||
@@ -1745,7 +1745,7 @@ public class Javadoc extends Task { | |||||
String link = null; | String link = null; | ||||
if (la.shouldResolveLink()) { | if (la.shouldResolveLink()) { | ||||
File hrefAsFile = | File hrefAsFile = | ||||
FILE_UTILS.resolveFile(getProject().getBaseDir(), la.getHref()); | |||||
getProject().resolveFile(la.getHref()); | |||||
if (hrefAsFile.exists()) { | if (hrefAsFile.exists()) { | ||||
try { | try { | ||||
link = FILE_UTILS.getFileURL(hrefAsFile) | link = FILE_UTILS.getFileURL(hrefAsFile) | ||||
@@ -133,7 +133,7 @@ public class TempFile extends Task { | |||||
throw new BuildException("no property specified"); | throw new BuildException("no property specified"); | ||||
} | } | ||||
if (destDir == null) { | if (destDir == null) { | ||||
destDir = FILE_UTILS.resolveFile(getProject().getBaseDir(),"."); | |||||
destDir = getProject().resolveFile("."); | |||||
} | } | ||||
File tfile = FILE_UTILS.createTempFile( | File tfile = FILE_UTILS.createTempFile( | ||||
prefix, suffix, destDir, deleteOnExit); | prefix, suffix, destDir, deleteOnExit); | ||||
@@ -341,7 +341,7 @@ public class Touch extends Task { | |||||
long modTime = (r.isExists()) ? r.getLastModified() | long modTime = (r.isExists()) ? r.getLastModified() | ||||
: defaultTimestamp; | : defaultTimestamp; | ||||
for (int i = 0; i < mapped.length; i++) { | for (int i = 0; i < mapped.length; i++) { | ||||
touch(FILE_UTILS.resolveFile(getProject().getBaseDir(),mapped[i]), modTime); | |||||
touch(getProject().resolveFile(mapped[i]), modTime); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -274,7 +274,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
try { | try { | ||||
if (baseDir == null) { | if (baseDir == null) { | ||||
baseDir = FILE_UTILS.resolveFile(getProject().getBaseDir(),"."); | |||||
baseDir = getProject().resolveFile("."); | |||||
} | } | ||||
liaison = getLiaison(); | liaison = getLiaison(); | ||||
@@ -289,7 +289,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
if (xslFile != null) { | if (xslFile != null) { | ||||
// If we enter here, it means that the stylesheet is supplied | // If we enter here, it means that the stylesheet is supplied | ||||
// via style attribute | // via style attribute | ||||
File stylesheet = FILE_UTILS.resolveFile(getProject().getBaseDir(), xslFile); | |||||
File stylesheet = getProject().resolveFile(xslFile); | |||||
if (!stylesheet.exists()) { | if (!stylesheet.exists()) { | ||||
stylesheet = FILE_UTILS.resolveFile(baseDir, xslFile); | stylesheet = FILE_UTILS.resolveFile(baseDir, xslFile); | ||||
/* | /* | ||||