Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/alicebot/server/core/util/SuffixFilenameFilter.java


1   // Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov.
2   // Jad home page: http://www.geocities.com/kpdus/jad.html
3   // Decompiler options: packimports(3) 
4   
5   package org.alicebot.server.core.util;
6   
7   import java.io.File;
8   import java.io.FilenameFilter;
9   
10  public class SuffixFilenameFilter
11      implements FilenameFilter
12  {
13  
14      public SuffixFilenameFilter(String as[])
15      {
16          SUFFIXES = as;
17      }
18  
19      public boolean accept(File file, String s)
20      {
21          if(s == null)
22              return false;
23          if(s.length() == 0)
24              return false;
25          for(int i = SUFFIXES.length; --i >= 0;)
26              if(s.endsWith(SUFFIXES[i]))
27                  return true;
28  
29          return false;
30      }
31  
32      private static String SUFFIXES[];
33  }