Class BasicWithExclusionsDescendantFileSource

    • Constructor Detail

      • BasicWithExclusionsDescendantFileSource

        public BasicWithExclusionsDescendantFileSource​(String rootDirectoryPath,
                                                       List<String> exclusions)
      • BasicWithExclusionsDescendantFileSource

        public BasicWithExclusionsDescendantFileSource​(File rootDirectory,
                                                       List<String> exclusions)
    • Method Detail

      • getFile

        public File getFile​(String path)
        Description copied from interface: FileSource
        Return the File, if it exists, that the given path represents for the FileSource implementation in use. Different implementations of FileSource can have different restrictions on the set of recognized paths. For instance, some implementations may only be able to handle paths that reference Files under a particular root directory.
        Specified by:
        getFile in interface FileSource
        Parameters:
        path - the path to the desired File.
        Returns:
        the File represented by the path or null.
      • getDescendant

        public DescendantFileSource getDescendant​(String relativePath)
        Description copied from interface: DescendantFileSource
        Return a DescendantFileSource representing the descendant directory specified by the relative path.
        Specified by:
        getDescendant in interface DescendantFileSource
        Parameters:
        relativePath - the relative path to the descendant directory.
        Returns:
        a FileLocator representing the descendant root directory or null if the path is null or the descendant directory doesn't exist or isn't a directory (or isn't a descendant).
      • getRootDirectory

        public File getRootDirectory()
        Description copied from interface: DescendantFileSource
        Return the root directory represented by this FileLocator as a java.io.File.
        Specified by:
        getRootDirectory in interface DescendantFileSource
        Returns:
        the root directory represented by this FileLocator.
      • getRootDirectoryPath

        public String getRootDirectoryPath()
        Description copied from interface: DescendantFileSource
        Return the path of the root directory represented by this FileLocator.
        Specified by:
        getRootDirectoryPath in interface DescendantFileSource
        Returns:
        the path of the root directory represented by this FileLocator.
      • isDescendant

        public boolean isDescendant​(File file)
        Description copied from interface: DescendantFileSource
        Return true if the given File is an existing descendant of the root directory, false otherwise.
        Specified by:
        isDescendant in interface DescendantFileSource
        Parameters:
        file - the File to be checked if it is a descendant.
        Returns:
        true if the given file is an existing descendant, false otherwise.
      • isDescendant

        public boolean isDescendant​(String filePath)
        Description copied from interface: DescendantFileSource
        Return true if the given file path is an existing descendant of the root directory, false otherwise.
        Specified by:
        isDescendant in interface DescendantFileSource
        Parameters:
        filePath - the file path to be checked if it is a descendant.
        Returns:
        true if the given file path represents an existing descendant, false otherwise.
      • getRelativePath

        public String getRelativePath​(File file)
        Description copied from interface: DescendantFileSource
        Return the path relative to the root directory that represents the given descendant file.
        Specified by:
        getRelativePath in interface DescendantFileSource
        Parameters:
        file - the File for which the relative path is to be determined.
        Returns:
        the path relative to the root directory that represents the given descendant file or null if the given file is null or not a descendant.
      • getRelativePath

        public String getRelativePath​(String filePath)
        Description copied from interface: DescendantFileSource
        Return the path relative to the root directory that represents the given descendant file path.
        Specified by:
        getRelativePath in interface DescendantFileSource
        Parameters:
        filePath - the file path for which the relative path is to be determined.
        Returns:
        the path relative to the root directory that represents the given descendant file path or null if the given file path is null or not a descendant.