FileDocCategorySizeDatePackage
ExtensionFilenameFilter.javaAPI DocExample823Tue Feb 14 13:32:12 GMT 2006com.elharo.io

ExtensionFilenameFilter

public class ExtensionFilenameFilter extends Object implements FilenameFilter

Fields Summary
ArrayList
extensions
Constructors Summary
public ExtensionFilenameFilter(String extension)


     

    if (extension.indexOf('.") != -1) {
      extension = extension.substring(extension.lastIndexOf('.")+1);
    }
    extensions.add(extension);
  
Methods Summary
public booleanaccept(java.io.File directory, java.lang.String filename)

  
    String extension = filename.substring(filename.lastIndexOf('.")+1);
    if (extensions.contains(extension)) {
      return true;
    }
    return false;
  
public voidaddExtension(java.lang.String extension)

  
    if (extension.indexOf('.") != -1) {
      extension = extension.substring(extension.lastIndexOf('.")+1);
    }
    extensions.add(extension);