com.bigdata.io
Class NameAndExtensionFilter

java.lang.Object
  extended by com.bigdata.io.NameAndExtensionFilter
All Implemented Interfaces:
FileFilter

public class NameAndExtensionFilter
extends Object
implements FileFilter

Helper class to filter for files with a known basename and extension.

Version:
$Id: NameAndExtensionFilter.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
NameAndExtensionFilter(String basename, String ext)
           
 
Method Summary
 boolean accept(File pathname)
          Accepts files ending with a .log extension whose name component is shared by the name component found in #getLogBaseName().
 String getBaseName()
          The basename parameter provided to the constructor.
 File[] getFiles()
          Return any existing log files within the directory identified by getBaseName().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameAndExtensionFilter

public NameAndExtensionFilter(String basename,
                              String ext)
Method Detail

getBaseName

public String getBaseName()
The basename parameter provided to the constructor.


accept

public boolean accept(File pathname)
Accepts files ending with a .log extension whose name component is shared by the name component found in #getLogBaseName().

Specified by:
accept in interface FileFilter

getFiles

public File[] getFiles()
Return any existing log files within the directory identified by getBaseName(). If the basename names a directory, then all files in that directory are scanned. Otherwise the parent directory which would contain any file created using basename is scanned.

Returns:
An array of zero or more files.


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.