Class UnixOperations


  • public class UnixOperations
    extends java.lang.Object
    Utility functions for operations on a Unix/Linux/(Mac) operating system.
    Author:
    Sascha El-Sharkawy
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UnixOperations()
      Avoid initialization of utility class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.File resolveSymbolicLink​(java.io.File file)
      Detect symbolic links and to resolve the original file, recursively.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnixOperations

        private UnixOperations()
        Avoid initialization of utility class.
    • Method Detail

      • resolveSymbolicLink

        public static java.io.File resolveSymbolicLink​(java.io.File file)
                                                throws java.io.IOException
        Detect symbolic links and to resolve the original file, recursively.
        Parameters:
        file - A file or folder which may be a symbolic link.
        Returns:
        The same file if it is null or if it is not a symbolic link, otherwise the target of the link will be returned.
        Throws:
        java.io.IOException - If an I/O error occurs, e.g. this command was executed on Windows
        See Also:
        http://docs.oracle.com/javase/tutorial/essential/io/links.html#detect