public class FileUtil
extends java.lang.Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(java.io.File source,
java.io.File sink)
Copies source to sink.
|
static java.lang.String |
getRelativePath(java.lang.String base,
java.lang.String fullPath)
Returns fullPath relative to base if base is indeed a sudirectory of fullpath.
|
static boolean |
isSubdirectory(java.io.File ancestor,
java.io.File subdirectory)
Returns true if the second directory argument is indeed a subdirectory
of the first directory argument.
|
public static void copy(java.io.File source, java.io.File sink) throws java.io.IOException
source
- data to copysink
- file to copy tojava.io.IOException
- if copy operation failedpublic static boolean isSubdirectory(java.io.File ancestor, java.io.File subdirectory)
ancestor
- base directorysubdirectory
- to be testedpublic static java.lang.String getRelativePath(java.lang.String base, java.lang.String fullPath)
base
- base directoryfullPath
- to be expressed as a relative path