public class FontFileFinder extends org.apache.commons.io.DirectoryWalker implements FontFinder
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DEPTH_LIMIT
default depth limit of recursion when searching for font files
|
Constructor and Description |
---|
FontFileFinder(FontEventListener listener)
Default constructor
|
FontFileFinder(int depthLimit,
FontEventListener listener)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.net.URL> |
find()
Automagically finds a list of font files on local system
|
java.util.List<java.net.URL> |
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) |
public static final int DEFAULT_DEPTH_LIMIT
public FontFileFinder(FontEventListener listener)
listener
- for throwing font related eventspublic FontFileFinder(int depthLimit, FontEventListener listener)
depthLimit
- recursion depth limitlistener
- for throwing font related eventsprotected static org.apache.commons.io.filefilter.IOFileFilter getDirectoryFilter()
protected static org.apache.commons.io.filefilter.IOFileFilter getFileFilter()
protected boolean handleDirectory(java.io.File directory, int depth, java.util.Collection results)
handleDirectory
in class org.apache.commons.io.DirectoryWalker
directory
- directory to handledepth
- recursion depthresults
- collectionprotected void handleFile(java.io.File file, int depth, java.util.Collection results)
handleFile
in class org.apache.commons.io.DirectoryWalker
file
- file to handledepth
- recursion depthresults
- collection
protected void handleDirectoryEnd(java.io.File directory, int depth, java.util.Collection results)
handleDirectoryEnd
in class org.apache.commons.io.DirectoryWalker
directory
- the directory being processeddepth
- the current directory levelresults
- the collection of results objects
public java.util.List<java.net.URL> find() throws java.io.IOException
find
in interface FontFinder
java.io.IOException
- io exception
In case of an I/O problempublic java.util.List<java.net.URL> find(java.lang.String dir) throws java.io.IOException
dir
- directory to searchjava.io.IOException
- thrown if an I/O exception of some sort has occurredCopyright 1999-2017 The Apache Software Foundation. All Rights Reserved.