: Class PathPattern

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jregex.util.io
Class PathPattern

    java.lang.Object
      |
      +--jregex.Pattern
            |
            +--jregex.util.io.PathPattern

All Implemented Interfaces:
  REFlags, java.io.Serializable

public class PathPattern
extends Pattern

A special-purpose subclass of the Pattern class. Has two different applications:

- to search files by their paths using special patterns;
- to match path strings Syntax:
- `?` - any character but path separator
- `*` - any string no including path separators
- `**` - any path
  Usage:

       PathPattern pp=new PathPattern("jregex/**"); //all files and directories
                                                    //under the jregex directory
       Enumeration files=pp.enumerateFiles();
       Matcher m=pp.matcher();
       while(files.hasMoreElements()){
          File f=(File)files.nextElement();
          m.setTarget(f.getPath());
          if(!m.matches()) System.out.println("Error in jregex.io.PathPattern");
       }

  See Also:
    `WildcardPattern`, Serialized Form

  Fields inherited from interface jregex.REFlags
  `DEFAULT, DOTALL, IGNORE_CASE, IGNORE_SPACES, MULTILINE, UNICODE, XML_SCHEMA`

  Constructor Summary
  `PathPattern(java.io.File dir, java.lang.String path, boolean icase)`
  `PathPattern(java.io.File dir, java.lang.String path, int flags)`
  `PathPattern(java.lang.String ptn)`
  `PathPattern(java.lang.String ptn, boolean icase)`
  `PathPattern(java.lang.String path, int flags)`

  Method Summary
  `java.io.File` | `directory()` Deprecated. Is meaningless with regard to variable paths (since v.1.2)
  `java.util.Enumeration` | `enumerateFiles()`
  `java.io.File[]` | `files()`
  `java.lang.String[]` | `names()` Deprecated. Is meaningless with regard to variable paths (since v.1.2)
  `java.lang.String` | `toString()`

  Methods inherited from class jregex.Pattern
  `compile, groupCount, groupId, matcher, matcher, matcher, matcher, matcher, matcher, matches, replacer, replacer, startsWith, tokenizer, tokenizer, tokenizer, toString_d`

  Methods inherited from class java.lang.Object
  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  Constructor Detail

  ### PathPattern

      public PathPattern(java.lang.String ptn)

  ### PathPattern

      public PathPattern(java.lang.String ptn,
                         boolean icase)

  ### PathPattern

      public PathPattern(java.lang.String path,
                         int flags)

  ### PathPattern

      public PathPattern(java.io.File dir,
                         java.lang.String path,
                         boolean icase)

  ### PathPattern

      public PathPattern(java.io.File dir,
                         java.lang.String path,
                         int flags)

  Method Detail

  ### enumerateFiles

      public java.util.Enumeration enumerateFiles()

  ### files

      public java.io.File[] files()

  ### names

      public java.lang.String[] names()

    Deprecated. Is meaningless with regard to variable paths (since v.1.2)

  ### directory

      public java.io.File directory()

    Deprecated. Is meaningless with regard to variable paths (since v.1.2)

  ### toString

      public java.lang.String toString()

    Overrides:
      `toString` in class `Pattern`

  Overview | Package | Class | Tree | Deprecated | Index | Help
  PREV CLASS NEXT CLASS | FRAMES NO FRAMES
  SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD