Java7Support (Commons IO 2.5)
Date: 2016-12-01

org.apache.commons.io

## Class Java7Support

- java.lang.Object
- - org.apache.commons.io.Java7Support

-      class Java7Support
      extends java.lang.Object

  Java7 feature detection and reflection based feature access.

  Taken from maven-shared-utils, only for private usage until we go full java7

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `Java7Support()`

  - ### Method Summary

    Methods
    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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### IS_JAVA7

          private static final boolean IS_JAVA7

    - #### isSymbolicLink

          private static java.lang.reflect.Method isSymbolicLink

    - #### delete

          private static java.lang.reflect.Method delete

    - #### toPath

          private static java.lang.reflect.Method toPath

    - #### exists

          private static java.lang.reflect.Method exists

    - #### toFile

          private static java.lang.reflect.Method toFile

    - #### readSymlink

          private static java.lang.reflect.Method readSymlink

    - #### createSymlink

          private static java.lang.reflect.Method createSymlink

    - #### emptyLinkOpts

          private static java.lang.Object emptyLinkOpts

    - #### emptyFileAttributes

          private static java.lang.Object emptyFileAttributes

  - ### Constructor Detail

    - #### Java7Support

          Java7Support()

  - ### Method Detail

    - #### isSymLink

          public static boolean isSymLink(java.io.File file)

      Invokes java7 isSymbolicLink
      Parameters:
        `file` - The file to check
      Returns:
        true if the file is a symbolic link

    - #### readSymbolicLink

          public static java.io.File readSymbolicLink(java.io.File symlink)
                                               throws java.io.IOException

      Reads the target of a symbolic link
      Parameters:
        `symlink` - The symlink to read
      Returns:
        The location the symlink is pointing to
      Throws:
        `java.io.IOException` - Upon failure

    - #### exists

          private static boolean exists(java.io.File file)
                                 throws java.io.IOException

      Indicates if a symlunk target exists
      Parameters:
        `file` - The symlink file
      Returns:
        true if the target exists
      Throws:
        `java.io.IOException` - upon error

    - #### createSymbolicLink

          public static java.io.File createSymbolicLink(java.io.File symlink,
                                        java.io.File target)
                                                 throws java.io.IOException

      Creates a symbolic link
      Parameters:
        `symlink` - The symlink to create
        `target` - Where it should point
      Returns:
        The newly created symlink
      Throws:
        `java.io.IOException` - upon error

    - #### delete

          public static void delete(java.io.File file)
                             throws java.io.IOException

      Performs a nio delete
      Parameters:
        `file` - the file to delete
      Throws:
        `java.io.IOException` - Upon error

    - #### isAtLeastJava7

          public static boolean isAtLeastJava7()

      Indicates if the current vm has java7 lubrary support
      Returns:
        true if java7 library support

Copyright (c) 2002-2016 Apache Software Foundation