Interface RebelSource


  • public interface RebelSource
    Abstraction of a dir or a jar element defined in a rebel.xml.
    Author:
    Rein Raudjärv
    • Method Detail

      • isDir

        boolean isDir()
        Returns:
        true if this is a directory source.
      • isJar

        boolean isJar()
        Returns:
        true if this is a JAR source.
      • getFile

        File getFile()
        Returns:
        the directory or JAR of this source. In case of a JAR this is the JAR file.
      • getDir

        File getDir()
        Returns:
        the directory of this source. In case of a JAR this is the location where the resources are unpacked to.
      • hasPatterns

        boolean hasPatterns()
        Returns:
        true if this source uses pattern matching.
      • acceptPath

        boolean acceptPath​(String path)
        Returns:
        true if this source may contain specified path i.e. path matches the pattern used by this source.
      • getAllPaths

        Set<String> getAllPaths()
        Returns all paths of this source (using pattern matching if enabled).

        All paths are relative to this source. Only / is used as a directory separator. All directory paths end with a / character. No leading characters are used.

        Returns:
        Set<String> all paths of this source.
      • getSubPaths

        Set<String> getSubPaths​(String parent)
        Returns a listing of all direct sub-paths beginning with the given prefix.

        The returned set contains both directories (ending with '/') and files.

        Parameters:
        parent - parent path (prefix for all sub-paths).
        Returns:
        direct sub-paths prefixed by the parent path or empty set if no sub-paths found (not null).