|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.common.util.FileUtil
@Immutable public class FileUtil
A set of utilities for working with files and directories.
Constructor Summary | |
---|---|
FileUtil()
|
Method Summary | |
---|---|
static URL |
convertFileToURL(String filePath)
Utility to convert File to URL . |
static int |
copy(File sourceFileOrDirectory,
File destinationFileOrDirectory)
Copy the source file system structure into the supplied target location. |
static int |
copy(File sourceFileOrDirectory,
File destinationFileOrDirectory,
FilenameFilter exclusionFilter)
Copy the source file system structure into the supplied target location. |
static boolean |
delete(File fileOrDirectory)
Delete the file or directory given by the supplied reference. |
static boolean |
delete(String path)
Delete the file or directory at the supplied path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtil()
Method Detail |
---|
public static boolean delete(String path)
File.delete()
method.
path
- the path to the file or directory that is to be deleted
public static boolean delete(File fileOrDirectory)
File.delete()
method.
fileOrDirectory
- the reference to the Java File object that is to be deleted
public static int copy(File sourceFileOrDirectory, File destinationFileOrDirectory) throws IOException
sourceFileOrDirectory
- the file or directory whose contents are to be copied into the target locationdestinationFileOrDirectory
- the location where the copy is to be placed; does not need to exist, but if it does its
type must match that of src
IllegalArgumentException
- if the src
or dest
references are null
IOException
public static int copy(File sourceFileOrDirectory, File destinationFileOrDirectory, FilenameFilter exclusionFilter) throws IOException
sourceFileOrDirectory
- the file or directory whose contents are to be copied into the target locationdestinationFileOrDirectory
- the location where the copy is to be placed; does not need to exist, but if it does its
type must match that of src
exclusionFilter
- a filter that matches files or folders that should _not_ be copied; null indicates that all files
and folders should be copied
IllegalArgumentException
- if the src
or dest
references are null
IOException
public static URL convertFileToURL(String filePath) throws MalformedURLException
File
to URL
.
filePath
- the path of the file
URL
representation of the file.
MalformedURLException
IllegalArgumentException
- if the file path is null, empty or blank
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |