Browse Source

Make FileUtils static access.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270287 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
dff89c5ee2
10 changed files with 18 additions and 38 deletions
  1. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  2. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  3. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java
  4. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Move.java
  5. +5
    -15
      proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java
  6. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/FixCRLF.java
  7. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java
  8. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/file/Copy.java
  9. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/file/Move.java
  10. +5
    -15
      proposal/myrmidon/src/todo/org/apache/tools/ant/util/FileUtils.java

+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -759,7 +759,7 @@ public class FixCRLF extends MatchingTask
{
// Compare the destination with the temp file
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 );
if( !destFile.delete() )


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -685,7 +685,7 @@ public class Rmic extends MatchingTask
if( filtering )
{
final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() );
FileUtils.newFileUtils().copyFile( oldFile, newFile, filters );
FileUtils.copyFile( oldFile, newFile, filters );
}
else
{


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Copy.java View File

@@ -368,7 +368,7 @@ public class Copy
FileUtil.forceDelete( dest );
}

FileUtils.newFileUtils().copyFile( src, dest, executionFilters );
FileUtils.copyFile( src, dest, executionFilters );

if( m_preserveLastModified )
{


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/file/Move.java View File

@@ -162,7 +162,7 @@ public class Move extends Copy
{
FileUtil.forceDelete( d );
}
FileUtils.newFileUtils().copyFile( f, d, executionFilters );
FileUtils.copyFile( f, d, executionFilters );

f = new File( fromFile );
if( !f.delete() )


+ 5
- 15
proposal/myrmidon/src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -35,16 +35,6 @@ import org.apache.tools.ant.types.FilterSetCollection;

public class FileUtils
{
/**
* Factory method.
*
* @return Description of the Returned Value
*/
public static FileUtils newFileUtils()
{
return new FileUtils();
}

/**
* Compares the contents of two files.
*
@@ -54,7 +44,7 @@ public class FileUtils
* @exception IOException Description of Exception
* @since 1.9
*/
public boolean contentEquals( File f1, File f2 )
public static boolean contentEquals( File f1, File f2 )
throws IOException
{
if( f1.exists() != f2.exists() )
@@ -135,9 +125,9 @@ public class FileUtils
* @param preserveLastModified Description of Parameter
* @throws IOException
*/
public void copyFile( File sourceFile,
File destFile,
FilterSetCollection filters )
public static void copyFile( File sourceFile,
File destFile,
FilterSetCollection filters )
throws IOException, TaskException
{
if( !destFile.exists() ||
@@ -218,7 +208,7 @@ public class FileUtils
* @return Description of the Returned Value
* @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
{
String orig = path;


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -759,7 +759,7 @@ public class FixCRLF extends MatchingTask
{
// Compare the destination with the temp file
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 );
if( !destFile.delete() )


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -685,7 +685,7 @@ public class Rmic extends MatchingTask
if( filtering )
{
final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() );
FileUtils.newFileUtils().copyFile( oldFile, newFile, filters );
FileUtils.copyFile( oldFile, newFile, filters );
}
else
{


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/file/Copy.java View File

@@ -368,7 +368,7 @@ public class Copy
FileUtil.forceDelete( dest );
}

FileUtils.newFileUtils().copyFile( src, dest, executionFilters );
FileUtils.copyFile( src, dest, executionFilters );

if( m_preserveLastModified )
{


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/file/Move.java View File

@@ -162,7 +162,7 @@ public class Move extends Copy
{
FileUtil.forceDelete( d );
}
FileUtils.newFileUtils().copyFile( f, d, executionFilters );
FileUtils.copyFile( f, d, executionFilters );

f = new File( fromFile );
if( !f.delete() )


+ 5
- 15
proposal/myrmidon/src/todo/org/apache/tools/ant/util/FileUtils.java View File

@@ -35,16 +35,6 @@ import org.apache.tools.ant.types.FilterSetCollection;

public class FileUtils
{
/**
* Factory method.
*
* @return Description of the Returned Value
*/
public static FileUtils newFileUtils()
{
return new FileUtils();
}

/**
* Compares the contents of two files.
*
@@ -54,7 +44,7 @@ public class FileUtils
* @exception IOException Description of Exception
* @since 1.9
*/
public boolean contentEquals( File f1, File f2 )
public static boolean contentEquals( File f1, File f2 )
throws IOException
{
if( f1.exists() != f2.exists() )
@@ -135,9 +125,9 @@ public class FileUtils
* @param preserveLastModified Description of Parameter
* @throws IOException
*/
public void copyFile( File sourceFile,
File destFile,
FilterSetCollection filters )
public static void copyFile( File sourceFile,
File destFile,
FilterSetCollection filters )
throws IOException, TaskException
{
if( !destFile.exists() ||
@@ -218,7 +208,7 @@ public class FileUtils
* @return Description of the Returned Value
* @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
{
String orig = path;


Loading…
Cancel
Save