Package org.codehaus.plexus.util
Class NioFiles
- java.lang.Object
-
- org.codehaus.plexus.util.NioFiles
-
public class NioFiles extends java.lang.Object
Encapsulates use of java7 features, exposing mostly backward compatible types
-
-
Constructor Summary
Constructors Constructor Description NioFiles()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
chmod(java.io.File file, int mode)
static java.io.File
copy(java.io.File source, java.io.File target)
static java.io.File
createSymbolicLink(java.io.File symlink, java.io.File target)
static boolean
deleteIfExists(java.io.File file)
static long
getLastModified(java.io.File file)
static boolean
isSymbolicLink(java.io.File file)
static java.io.File
readSymbolicLink(java.io.File symlink)
Reads the target of the symbolic link
-
-
-
Method Detail
-
isSymbolicLink
public static boolean isSymbolicLink(java.io.File file)
-
chmod
public static void chmod(java.io.File file, int mode) throws java.io.IOException
- Throws:
java.io.IOException
-
getLastModified
public static long getLastModified(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
readSymbolicLink
public static java.io.File readSymbolicLink(java.io.File symlink) throws java.io.IOException
Reads the target of the symbolic link- Parameters:
symlink
- A file that is a symlink- Returns:
- A file that is the target of the symlink
- Throws:
java.io.IOException
- io issue
-
createSymbolicLink
public static java.io.File createSymbolicLink(java.io.File symlink, java.io.File target) throws java.io.IOException
- Throws:
java.io.IOException
-
deleteIfExists
public static boolean deleteIfExists(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
copy
public static java.io.File copy(java.io.File source, java.io.File target) throws java.io.IOException
- Throws:
java.io.IOException
-
-