Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.fonts.autodetect
Class FontFileFinder

    java.lang.Object
      org.apache.commons.io.DirectoryWalker
          org.apache.fop.fonts.autodetect.FontFileFinder

All Implemented Interfaces:
  FontFinder

public class FontFileFinder
extends org.apache.commons.io.DirectoryWalker
implements FontFinder

Helps to autodetect/locate available operating system fonts.

Nested Class Summary

Nested classes inherited from class org.apache.commons.io.DirectoryWalker
`org.apache.commons.io.DirectoryWalker.CancelException`

Field Summary
`static int` | `DEFAULT_DEPTH_LIMIT` default depth limit of recursion when searching for font files

Constructor Summary
`FontFileFinder()` Default constructor
`FontFileFinder(int depthLimit)` Constructor

Method Summary
`java.util.List` | `find()` Automagically finds a list of font files on local system
`java.util.List` | `find(java.lang.String dir)` Searches a given directory for font files
`protected static org.apache.commons.io.filefilter.IOFileFilter` | `getDirectoryFilter()` Font directory filter.
`protected static org.apache.commons.io.filefilter.IOFileFilter` | `getFileFilter()` Font file filter.
`protected boolean` | `handleDirectory(java.io.File directory, int depth, java.util.Collection results)`
`protected void` | `handleDirectoryEnd(java.io.File directory, int depth, java.util.Collection results)`
`protected void` | `handleFile(java.io.File file, int depth, java.util.Collection results)`

Methods inherited from class org.apache.commons.io.DirectoryWalker
`checkIfCancelled, handleCancelled, handleDirectoryStart, handleEnd, handleIsCancelled, handleRestricted, handleStart, walk`

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

Field Detail

### DEFAULT_DEPTH_LIMIT

    public static final int DEFAULT_DEPTH_LIMIT

  default depth limit of recursion when searching for font files

  See Also:
    Constant Field Values

Constructor Detail

### FontFileFinder

    public FontFileFinder()

  Default constructor

### FontFileFinder

    public FontFileFinder(int depthLimit)

  Constructor

Parameters:
  `depthLimit` - recursion depth limit

Method Detail

### getDirectoryFilter

    protected static org.apache.commons.io.filefilter.IOFileFilter getDirectoryFilter()

  Font directory filter. Currently ignores hidden directories.

  Returns:
    IOFileFilter font directory filter

### getFileFilter

    protected static org.apache.commons.io.filefilter.IOFileFilter getFileFilter()

  Font file filter. Currently searches for files with .ttf, .ttc, .otf, and .pfb extensions.

  Returns:
    IOFileFilter font file filter

### handleDirectory

    protected boolean handleDirectory(java.io.File directory,
                                      int depth,
                                      java.util.Collection results)

  Parameters:
    `directory` - directory to handle
    `depth` - recursion depth
    `results` - collection
  Returns:
    whether directory should be handled

### handleFile

    protected void handleFile(java.io.File file,
                              int depth,
                              java.util.Collection results)

  Parameters:
    `file` - file to handle
    `depth` - recursion depth
    `results` - collection

### handleDirectoryEnd

    protected void handleDirectoryEnd(java.io.File directory,
                                      int depth,
                                      java.util.Collection results)

  Parameters:
    `directory` - the directory being processed
    `depth` - the current directory level
    `results` - the collection of results objects

### find

    public java.util.List find()
                        throws java.io.IOException

  Automagically finds a list of font files on local system

  Specified by:
    `find` in interface `FontFinder`
  Returns:
    List<URL> of font files
  Throws:
    `java.io.IOException` - io exception In case of an I/O problem

### find

    public java.util.List find(java.lang.String dir)
                        throws java.io.IOException

  Searches a given directory for font files

  Parameters:
    `dir` - directory to search
  Returns:
    list of font files
  Throws:
    `java.io.IOException` - thrown if an I/O exception of some sort has occurred

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.