public class FileUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static File |
BIT_BUCKET
Bit bucket.
|
static File |
CWD
Current working directory.
|
static File |
ROOT
Root directory of the file system.
|
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
chmod(Path path,
int mode)
Set file permissions, just like chmod(2).
|
static Path |
createAnonymousSymlink(Path target)
Create a temporary symbolic link pointing to specified target path
|
static File |
followSymlink(File file)
Follow every symlink in every component of given file recursively, just like
readlink -f does. |
static File |
getCwd()
Return process current working directory.
|
static void |
linkOrCopy(Path source,
Path target)
Create hard link or copy file if creating hard link is not possible.
|
public static final File CWD
public static final File ROOT
public static final File BIT_BUCKET
public static File followSymlink(File file)
readlink -f does.file - path in which symlinks are to be followedpublic static File getCwd()
public static void linkOrCopy(Path source, Path target) throws IOException
source - source filetarget - link target or destination fileIOException - if any I/O exception occurspublic static Path createAnonymousSymlink(Path target) throws IOException
target - target of the symbolic linkIOException - if any I/O exception occurspublic static void chmod(Path path, int mode) throws IOException
path - path to file to change permissions ofmode - permissions in integer formatIOException - in an I/O exception occursCopyright © 2012-2013 Red Hat, Inc.. All Rights Reserved.