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

Quick Search    Search Deep

Source code: com/obinary/cms/util/FileNameFilter.java


1   /**
2    *
3    * Magnolia and its source-code is licensed under the LGPL.
4    * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5    * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6    * you are required to provide proper attribution to obinary.
7    * If you reproduce or distribute the document without making any substantive modifications to its content,
8    * please use the following attribution line:
9    *
10   * Copyright 1993-2003 obinary Ltd. (http://www.obinary.com) All rights reserved.
11   *
12   * */
13  
14  
15  
16  
17  package com.obinary.cms.util;
18  
19  
20  import java.io.FilenameFilter;
21  import java.io.File;
22  
23  
24  /**
25   * Date: Apr 28, 2003
26   * Time: 11:20:59 AM
27   * @author Sameer Charles
28   * @version 1.0
29   */
30  
31  
32  public class FileNameFilter implements FilenameFilter {
33  
34  
35      private String searchString = "";
36  
37  
38      public void setSearchString(String name) {
39          this.searchString = name;
40      }
41  
42  
43  
44      public boolean accept(File dir, String name) {
45          if (name.indexOf(this.searchString+".") == 0)
46              return true;
47          return false;
48      }
49  
50  
51  
52  }