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)
Creates a symbolic link
|
static void |
delete(java.io.File file)
Performs a nio delete
|
private static boolean |
exists(java.io.File file)
Indicates if a symlunk target exists
|
static boolean |
isAtLeastJava7()
Indicates if the current vm has java7 lubrary support
|
static boolean |
isSymLink(java.io.File file)
Invokes java7 isSymbolicLink
|
static java.io.File |
readSymbolicLink(java.io.File symlink)
Reads the target of a symbolic link
|
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(java.io.File file)
file
- The file to checkpublic static java.io.File readSymbolicLink(java.io.File symlink) throws java.io.IOException
symlink
- The symlink to readjava.io.IOException
- Upon failureprivate static boolean exists(java.io.File file) throws java.io.IOException
file
- The symlink filejava.io.IOException
- upon errorpublic static java.io.File createSymbolicLink(java.io.File symlink, java.io.File target) throws java.io.IOException
symlink
- The symlink to createtarget
- Where it should pointjava.io.IOException
- upon errorpublic static void delete(java.io.File file) throws java.io.IOException
file
- the file to deletejava.io.IOException
- Upon errorpublic static boolean isAtLeastJava7()