git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270287 13f79535-47bb-0310-9956-ffa450edef68master
@@ -759,7 +759,7 @@ public class FixCRLF extends MatchingTask | |||||
{ | { | ||||
// Compare the destination with the temp file | // Compare the destination with the temp file | ||||
log( "destFile exists", Project.MSG_DEBUG ); | log( "destFile exists", Project.MSG_DEBUG ); | ||||
if( !FileUtils.newFileUtils().contentEquals( destFile, tmpFile ) ) | |||||
if( !FileUtils.contentEquals( destFile, tmpFile ) ) | |||||
{ | { | ||||
log( destFile + " is being written", Project.MSG_DEBUG ); | log( destFile + " is being written", Project.MSG_DEBUG ); | ||||
if( !destFile.delete() ) | if( !destFile.delete() ) | ||||
@@ -685,7 +685,7 @@ public class Rmic extends MatchingTask | |||||
if( filtering ) | if( filtering ) | ||||
{ | { | ||||
final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() ); | final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() ); | ||||
FileUtils.newFileUtils().copyFile( oldFile, newFile, filters ); | |||||
FileUtils.copyFile( oldFile, newFile, filters ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -368,7 +368,7 @@ public class Copy | |||||
FileUtil.forceDelete( dest ); | FileUtil.forceDelete( dest ); | ||||
} | } | ||||
FileUtils.newFileUtils().copyFile( src, dest, executionFilters ); | |||||
FileUtils.copyFile( src, dest, executionFilters ); | |||||
if( m_preserveLastModified ) | if( m_preserveLastModified ) | ||||
{ | { | ||||
@@ -162,7 +162,7 @@ public class Move extends Copy | |||||
{ | { | ||||
FileUtil.forceDelete( d ); | FileUtil.forceDelete( d ); | ||||
} | } | ||||
FileUtils.newFileUtils().copyFile( f, d, executionFilters ); | |||||
FileUtils.copyFile( f, d, executionFilters ); | |||||
f = new File( fromFile ); | f = new File( fromFile ); | ||||
if( !f.delete() ) | if( !f.delete() ) | ||||
@@ -35,16 +35,6 @@ import org.apache.tools.ant.types.FilterSetCollection; | |||||
public class FileUtils | public class FileUtils | ||||
{ | { | ||||
/** | |||||
* Factory method. | |||||
* | |||||
* @return Description of the Returned Value | |||||
*/ | |||||
public static FileUtils newFileUtils() | |||||
{ | |||||
return new FileUtils(); | |||||
} | |||||
/** | /** | ||||
* Compares the contents of two files. | * Compares the contents of two files. | ||||
* | * | ||||
@@ -54,7 +44,7 @@ public class FileUtils | |||||
* @exception IOException Description of Exception | * @exception IOException Description of Exception | ||||
* @since 1.9 | * @since 1.9 | ||||
*/ | */ | ||||
public boolean contentEquals( File f1, File f2 ) | |||||
public static boolean contentEquals( File f1, File f2 ) | |||||
throws IOException | throws IOException | ||||
{ | { | ||||
if( f1.exists() != f2.exists() ) | if( f1.exists() != f2.exists() ) | ||||
@@ -135,9 +125,9 @@ public class FileUtils | |||||
* @param preserveLastModified Description of Parameter | * @param preserveLastModified Description of Parameter | ||||
* @throws IOException | * @throws IOException | ||||
*/ | */ | ||||
public void copyFile( File sourceFile, | |||||
File destFile, | |||||
FilterSetCollection filters ) | |||||
public static void copyFile( File sourceFile, | |||||
File destFile, | |||||
FilterSetCollection filters ) | |||||
throws IOException, TaskException | throws IOException, TaskException | ||||
{ | { | ||||
if( !destFile.exists() || | if( !destFile.exists() || | ||||
@@ -218,7 +208,7 @@ public class FileUtils | |||||
* @return Description of the Returned Value | * @return Description of the Returned Value | ||||
* @throws java.lang.NullPointerException if the file path is equal to null. | * @throws java.lang.NullPointerException if the file path is equal to null. | ||||
*/ | */ | ||||
public File normalize( String path ) | |||||
public static File normalize( String path ) | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
String orig = path; | String orig = path; | ||||
@@ -759,7 +759,7 @@ public class FixCRLF extends MatchingTask | |||||
{ | { | ||||
// Compare the destination with the temp file | // Compare the destination with the temp file | ||||
log( "destFile exists", Project.MSG_DEBUG ); | log( "destFile exists", Project.MSG_DEBUG ); | ||||
if( !FileUtils.newFileUtils().contentEquals( destFile, tmpFile ) ) | |||||
if( !FileUtils.contentEquals( destFile, tmpFile ) ) | |||||
{ | { | ||||
log( destFile + " is being written", Project.MSG_DEBUG ); | log( destFile + " is being written", Project.MSG_DEBUG ); | ||||
if( !destFile.delete() ) | if( !destFile.delete() ) | ||||
@@ -685,7 +685,7 @@ public class Rmic extends MatchingTask | |||||
if( filtering ) | if( filtering ) | ||||
{ | { | ||||
final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() ); | final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() ); | ||||
FileUtils.newFileUtils().copyFile( oldFile, newFile, filters ); | |||||
FileUtils.copyFile( oldFile, newFile, filters ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -368,7 +368,7 @@ public class Copy | |||||
FileUtil.forceDelete( dest ); | FileUtil.forceDelete( dest ); | ||||
} | } | ||||
FileUtils.newFileUtils().copyFile( src, dest, executionFilters ); | |||||
FileUtils.copyFile( src, dest, executionFilters ); | |||||
if( m_preserveLastModified ) | if( m_preserveLastModified ) | ||||
{ | { | ||||
@@ -162,7 +162,7 @@ public class Move extends Copy | |||||
{ | { | ||||
FileUtil.forceDelete( d ); | FileUtil.forceDelete( d ); | ||||
} | } | ||||
FileUtils.newFileUtils().copyFile( f, d, executionFilters ); | |||||
FileUtils.copyFile( f, d, executionFilters ); | |||||
f = new File( fromFile ); | f = new File( fromFile ); | ||||
if( !f.delete() ) | if( !f.delete() ) | ||||
@@ -35,16 +35,6 @@ import org.apache.tools.ant.types.FilterSetCollection; | |||||
public class FileUtils | public class FileUtils | ||||
{ | { | ||||
/** | |||||
* Factory method. | |||||
* | |||||
* @return Description of the Returned Value | |||||
*/ | |||||
public static FileUtils newFileUtils() | |||||
{ | |||||
return new FileUtils(); | |||||
} | |||||
/** | /** | ||||
* Compares the contents of two files. | * Compares the contents of two files. | ||||
* | * | ||||
@@ -54,7 +44,7 @@ public class FileUtils | |||||
* @exception IOException Description of Exception | * @exception IOException Description of Exception | ||||
* @since 1.9 | * @since 1.9 | ||||
*/ | */ | ||||
public boolean contentEquals( File f1, File f2 ) | |||||
public static boolean contentEquals( File f1, File f2 ) | |||||
throws IOException | throws IOException | ||||
{ | { | ||||
if( f1.exists() != f2.exists() ) | if( f1.exists() != f2.exists() ) | ||||
@@ -135,9 +125,9 @@ public class FileUtils | |||||
* @param preserveLastModified Description of Parameter | * @param preserveLastModified Description of Parameter | ||||
* @throws IOException | * @throws IOException | ||||
*/ | */ | ||||
public void copyFile( File sourceFile, | |||||
File destFile, | |||||
FilterSetCollection filters ) | |||||
public static void copyFile( File sourceFile, | |||||
File destFile, | |||||
FilterSetCollection filters ) | |||||
throws IOException, TaskException | throws IOException, TaskException | ||||
{ | { | ||||
if( !destFile.exists() || | if( !destFile.exists() || | ||||
@@ -218,7 +208,7 @@ public class FileUtils | |||||
* @return Description of the Returned Value | * @return Description of the Returned Value | ||||
* @throws java.lang.NullPointerException if the file path is equal to null. | * @throws java.lang.NullPointerException if the file path is equal to null. | ||||
*/ | */ | ||||
public File normalize( String path ) | |||||
public static File normalize( String path ) | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
String orig = path; | String orig = path; | ||||