Source code: com/flexstor/common/io/xfile/webnfs/filters/WebNfsDirFilter.java
1 /*
2 * WebNfsDirFilter.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:42 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.common.io.xfile.webnfs.filters;
12
13 import com.flexstor.common.io.xfile.FlexXFileI;
14 import com.flexstor.common.io.xfile.webnfs.WebNfsFilenameFilter;
15 import com.sun.xfile.XFile;
16
17 /**
18 * DIRFilter
19 * Filters out all files, and accepts only directories
20 * used when Browsing for images locations.
21 **/
22 public class WebNfsDirFilter
23 implements WebNfsFilenameFilter
24 {
25
26 public boolean accept( XFile xfile, String s )
27 {
28 if(xfile != null)
29 {
30 XFile newFile = new XFile(xfile, s);
31 if(newFile.isDirectory())
32 {
33 return true;
34 }
35 else
36 {
37 return false;
38 }
39 }
40 else
41 {
42 return false;
43 }
44 }
45
46 public boolean accept(FlexXFileI xfile, String s)
47 {
48 if ( xfile != null && (xfile instanceof XFile) )
49 return accept( (XFile)xfile, s );
50 else
51 return false;
52 }
53
54 }