Class FilePermissions


  • @Beta
    public class FilePermissions
    extends Object
    Non-IDE specific utility methods for working with file systems. We hope to migrate these into Guava. Clients should beware that these methods are not yet stable and may change without notice.
    • Constructor Detail

      • FilePermissions

        public FilePermissions()
    • Method Detail

      • verifyDirectoryCreatable

        public static void verifyDirectoryCreatable​(Path path)
                                             throws AccessDeniedException,
                                                    NotDirectoryException
        Check whether the current process can create a directory at the specified path. This is useful for providing immediate feedback to an end user that a path they have selected or typed may not be suitable before attempting to create the directory; e.g. in a tooltip.
        Parameters:
        path - tentative location for directory
        Throws:
        AccessDeniedException - if a directory in the path is not writable
        NotDirectoryException - if a segment of the path is a file