Class IOUtilities


  • public class IOUtilities
    extends Object
    Collection of I/O Utilities
    Author:
    KIYUT
    • Method Detail

      • getFileChooser

        public static JFileChooser getFileChooser()
        Return JFileChooser that remember the last opened directory based on System.getProperty("user.dir") value
        Returns:
        JFileChooser
      • setUserDir

        public static void setUserDir​(File file)
        Convenience methods to set user's current working directory aka System.getProperty("user.dir"). If the param is not a directory it will look for the contained directory, if null set as FileSystemView.getFileSystemView().getDefaultDirectory(), otherwise just set as it is.
        Parameters:
        file - File
      • relativize

        public static String relativize​(File base,
                                        File file)
      • getExtension

        public static String getExtension​(File file)
        Return the extension portion of the file's name or null.
        Parameters:
        file - File
        Returns:
        the extension portion of the file's name or null.