Class Directory


  • public class Directory
    extends Object
    Directory of a file system.
    • Constructor Detail

      • Directory

        public Directory()
    • Method Detail

      • current

        public static String current()
        Retrieves the current directory for the current process.
        Returns:
        the current directory for the current process.
      • findFiles

        public static void findFiles​(String directoryPath,
                                     String pattern,
                                     Directory.FileNames names)
        Returns a collection of strings naming the files in the directory denoted by the given pathname that satisfy the specified filename pattern. The filename pattern can contain wildcard characters ('*' and '?'). The filename pattern can contain wildcard characters ('*' and '?').
        Parameters:
        directoryPath - directory path
        pattern - filename patterns to be found
        names - found filenames
      • isDirectory

        public static boolean isDirectory​(String path)
        Checks that the given file path represents a directory.
        Parameters:
        path - file path to be checked
        Returns:
        true if and only if the file denoted by this abstract pathname exists and is a directory; false otherwise
      • create

        public static boolean create​(String path)
        Creates directory for the given path.
        Parameters:
        path - path of the directory to be created
        Returns:
        true if and only if the directory was created, along with all necessary parent directories; false otherwise