Class UnixStyleGlobbing


  • public class UnixStyleGlobbing
    extends Object
    Provides UNIX-style globbing over paths. This class is intended for use in implementing file systems. Globbing is performed by breadth-first recursive decent over the file system, applying an appropriate filter at each level.

    A limited form of UNIX file globbing is supported. The standard wildcards '*' and '?' may be used, as may character sets (delimited by '[' and ']'). Alternations - {a,b,c} for example - are supported, but alternatives may not span directories. That is, {a/b,c} is not valid.

    • Constructor Detail

      • UnixStyleGlobbing

        public UnixStyleGlobbing​(FileSystem fs,
                                 UnixStyleGlobbing.GlobDefinition glob)
        Constructs a globber for the specified file system using the defined globbing.
        Parameters:
        fs - the file system to which globbing is applied
        glob - the matching pattern to use
    • Method Detail

      • findMatches

        public List<PathDetails> findMatches()
                                      throws IOException
        Returns paths that match defined glob pattern.
        Throws:
        IOException - thrown if an I/O error occurs accessing paths