|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.util.FileUtils
This class also encapsulates methods which allow Files to be refered to using abstract path names which are translated to native system file paths at runtime as well as copying files or setting there last modification time.
Constructor Summary | |
protected |
FileUtils()
Empty constructor. |
Method Summary | |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile)
Convienence method to copy a file from a source to a destination. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
FilterSetCollection filters)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
FilterSetCollection filters,
boolean overwrite)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used and if source files may overwrite newer destination files. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
FilterSetCollection filters,
boolean overwrite,
boolean preserveLastModified)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used, if source files may overwrite newer destination files and the last modified time of destFile file should be made equal
to the last modified time of sourceFile . |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile)
Convienence method to copy a file from a source to a destination. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
FilterSetCollection filters)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
FilterSetCollection filters,
boolean overwrite)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used and if source files may overwrite newer destination files. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
FilterSetCollection filters,
boolean overwrite,
boolean preserveLastModified)
Convienence method to copy a file from a source to a destination specifying if token filtering must be used, if source files may overwrite newer destination files and the last modified time of destFile file should be made equal
to the last modified time of sourceFile . |
protected java.lang.reflect.Method |
getSetLastModified()
see whether we have a setLastModified method in File and return it. |
static FileUtils |
newFileUtils()
Factory method. |
java.io.File |
normalize(java.lang.String path)
"normalize" the given absolute path. |
java.io.File |
resolveFile(java.io.File file,
java.lang.String filename)
Interpret the filename as a file relative to the given file - unless the filename already represents an absolute filename. |
void |
setFileLastModified(java.io.File file,
long time)
Calls File.setLastModified(long time) in a Java 1.1 compatible way. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected FileUtils()
Method Detail |
public static FileUtils newFileUtils()
public void copyFile(java.lang.String sourceFile, java.lang.String destFile) throws java.io.IOException
java.io.IOException
- public void copyFile(java.lang.String sourceFile, java.lang.String destFile, FilterSetCollection filters) throws java.io.IOException
java.io.IOException
- public void copyFile(java.lang.String sourceFile, java.lang.String destFile, FilterSetCollection filters, boolean overwrite) throws java.io.IOException
java.io.IOException
- public void copyFile(java.lang.String sourceFile, java.lang.String destFile, FilterSetCollection filters, boolean overwrite, boolean preserveLastModified) throws java.io.IOException
destFile
file should be made equal
to the last modified time of sourceFile
.java.io.IOException
- public void copyFile(java.io.File sourceFile, java.io.File destFile) throws java.io.IOException
java.io.IOException
- public void copyFile(java.io.File sourceFile, java.io.File destFile, FilterSetCollection filters) throws java.io.IOException
java.io.IOException
- public void copyFile(java.io.File sourceFile, java.io.File destFile, FilterSetCollection filters, boolean overwrite) throws java.io.IOException
java.io.IOException
- public void copyFile(java.io.File sourceFile, java.io.File destFile, FilterSetCollection filters, boolean overwrite, boolean preserveLastModified) throws java.io.IOException
destFile
file should be made equal
to the last modified time of sourceFile
.java.io.IOException
- protected final java.lang.reflect.Method getSetLastModified()
public void setFileLastModified(java.io.File file, long time) throws BuildException
public java.io.File resolveFile(java.io.File file, java.lang.String filename)
file
- the "reference" file for relative paths. This
instance must be an absolute file and must not contain
"./" or "../" sequences (same for \ instead
of /).filename
- a file namepublic java.io.File normalize(java.lang.String path)
This includes:
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |