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

## cryptix.util.io
Class DosFilter

    java.lang.Object
      |
      +--cryptix.util.io.DosFilter

public class DosFilter
extends Object
implements java.io.FilenameFilter

A java.io.FilenameFilter class that filters directory contents according to traditional DOS wildcard conventions; i.e. the filter is split into two parts: a filename and an extension. In each part '*' replaces any number of characters, and '?' replaces any one character.

Note: this is slightly different to the Windows 95/NT conventions, where filename and extension are not treated separately. E.g. "*" in 95/NT matches all files, whereas for this class "*.*" would have to be used.

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Since:
  Cryptix 2.2.2
Author:
  Raif S. Naffah

Constructor Summary
`DosFilter()` Constructs a DosFilter that matches all files.
`DosFilter(String mask)` Constructs a DosFilter for files that match mask.

Method Summary
`boolean` | `accept(java.io.File dir, String name)` FilenameFilter interface implementation to handle ambiguous filename selection in a given directory.
`String` | `getMask()` Gets the current value of the mask for this filter.
`void` | `reset()` Resets the mask so that all files will be matched.
`void` | `setMask(String mask)` Sets the mask this filter will be using from now on.
`String` | `toString()`

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

Constructor Detail

### DosFilter

    public DosFilter()

  Constructs a DosFilter that matches all files.

### DosFilter

    public DosFilter(String mask)

  Constructs a DosFilter for files that match mask.
  Parameters:
    `mask` - a string that may contain '*' and '?' characters.

Method Detail

### accept

    public boolean accept(java.io.File dir,
                          String name)

  FilenameFilter interface implementation to handle ambiguous filename selection in a given directory.

  Tests if a specified file should be included in a file list of a given directory.

  Specified by:
    accept in interface java.io.FilenameFilter
  Parameters:
    `dir` - the directory in which the File object name was found.
    `name` - the name of the File object.
  Returns:
    true if the name is that of a File object that should be included in the file list; false otherwise. Directories are always accepted, disregarding the set filter mask.

### reset

    public void reset()

  Resets the mask so that all files will be matched.

### setMask

    public void setMask(String mask)

  Sets the mask this filter will be using from now on.
  Parameters:
    `mask` - a string that may contain '*' and '?' characters.

### getMask

    public String getMask()

  Gets the current value of the mask for this filter.

### toString

    public String toString()

  Overrides:
    toString in class Object

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

Copyright (C) 1995-2000 The Cryptix Foundation Ltd. All rights reserved.