public class Java7Support
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Method |
createSymlink |
private static java.lang.reflect.Method |
delete |
private static java.lang.Object |
emptyFileAttributes |
private static java.lang.Object |
emptyLinkOpts |
private static java.lang.reflect.Method |
exists |
private static boolean |
IS_JAVA7 |
private static java.lang.reflect.Method |
isSymbolicLink |
private static java.lang.reflect.Method |
readSymlink |
private static java.lang.reflect.Method |
toFile |
private static java.lang.reflect.Method |
toPath |
Constructor and Description |
---|
Java7Support() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
createSymbolicLink(java.io.File symlink,
java.io.File target) |
static void |
delete(java.io.File file)
Performs a nio delete
|
static boolean |
exists(java.io.File file) |
static boolean |
isAtLeastJava7() |
static boolean |
isJava7() |
static boolean |
isSymLink(java.io.File file) |
static java.io.File |
readSymbolicLink(java.io.File symlink) |
private static final boolean IS_JAVA7
private static java.lang.reflect.Method isSymbolicLink
private static java.lang.reflect.Method delete
private static java.lang.reflect.Method toPath
private static java.lang.reflect.Method exists
private static java.lang.reflect.Method toFile
private static java.lang.reflect.Method readSymlink
private static java.lang.reflect.Method createSymlink
private static java.lang.Object emptyLinkOpts
private static java.lang.Object emptyFileAttributes
public static boolean isSymLink(@Nonnull java.io.File file)
file
- The file to check for being a symbolic link.@Nonnull public static java.io.File readSymbolicLink(@Nonnull java.io.File symlink) throws java.io.IOException
symlink
- The sym link.java.io.IOException
- in case of error.public static boolean exists(@Nonnull java.io.File file) throws java.io.IOException
file
- The file to check.java.io.IOException
- in case of failure.@Nonnull public static java.io.File createSymbolicLink(@Nonnull java.io.File symlink, @Nonnull java.io.File target) throws java.io.IOException
symlink
- The link name.target
- The target.java.io.IOException
- in case of an error.public static void delete(@Nonnull java.io.File file) throws java.io.IOException
file
- the file to deletejava.io.IOException
- in case of error.public static boolean isJava7()
public static boolean isAtLeastJava7()