allensoft.io
Class UnixFileSupport

java.lang.Object
  |
  +--allensoft.io.UnixFileSupport

public class UnixFileSupport
extends java.lang.Object

Provides a means for getting and setting UNIX file permissions for a file.


Constructor Summary
UnixFileSupport()
           
 
Method Summary
static UnixFilePermissions getPermissions(java.io.File file)
          Gets the Unix file permissions for the specified file.
static boolean isEnabled()
          Checks if support for UNIX file handling is enabled on the host operating system.
static void setModificationTime(java.io.File file, java.util.Date date)
           
static void setPermissions(java.io.File file, UnixFilePermissions permissions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnixFileSupport

public UnixFileSupport()
Method Detail

isEnabled

public static boolean isEnabled()
Checks if support for UNIX file handling is enabled on the host operating system. This is determined by whether the native library was available for the OS or not.

getPermissions

public static UnixFilePermissions getPermissions(java.io.File file)
                                          throws java.io.IOException
Gets the Unix file permissions for the specified file. If the native library could not be loaded an IOException is thrown indicating that Unix file support is not enabled.

setPermissions

public static void setPermissions(java.io.File file,
                                  UnixFilePermissions permissions)
                           throws java.io.IOException

setModificationTime

public static void setModificationTime(java.io.File file,
                                       java.util.Date date)
                                throws java.io.IOException