Class FileUtils


  • public class FileUtils
    extends Object
    • Constructor Detail

      • FileUtils

        public FileUtils()
    • Method Detail

      • idToPath

        public static String idToPath​(String pathId)
      • closeQuietly

        public static boolean closeQuietly​(FileInputStream fileInputStream)
        Gracefully closes a fileInputStream
        Parameters:
        fileInputStream - The FileInputStream
        Returns:
        returns true if the file input stream is successfully closed, false otherwise
      • containsReservedCharacter

        public static boolean containsReservedCharacter​(String path,
                                                        char[] reserved)
        Checks whether path contains any of reserved.
        Parameters:
        path - unix-style path
        reserved - array of reserved characters
        Returns:
        true if any of reserved is contained by path
      • containsControlCharacters

        public static boolean containsControlCharacters​(String path)
        Checks whether path contains any of Control Characters
        Parameters:
        path - to be validated
        Returns:
        true if any of Control Characters is contained in path
      • convertCommaSeparatedStringToArray

        public static String[] convertCommaSeparatedStringToArray​(String stringToConvert)
      • getParentPath

        public static String getParentPath​(String path)
      • isRootLevelPath

        public static boolean isRootLevelPath​(String path)