01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * See the License for the specific language governing rights and
10: * limitations under the License.
11: *
12: * The Initial Developer of the Original Code is Simulacra Media Ltd.
13: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14: *
15: * All Rights Reserved.
16: *
17: * Contributor(s):
18: */
19: package org.openharmonise.vfs.search;
20:
21: /**
22: * Defines the scope of a Virtual File System search, in terms of
23: * collections.
24: *
25: * @author Matthew Large
26: * @version $Revision: 1.1 $
27: *
28: */
29: public class Scope {
30:
31: /**
32: * Full path of the scope collection.
33: */
34: private String m_sScopePath = null;
35:
36: /**
37: * true if sub-collections are to be searched.
38: */
39: private boolean m_bIncludeSubDirs = false;
40:
41: /**
42: * Constructs a new scope.
43: *
44: * @param sScopePath Full path to restrict by
45: */
46: public Scope(String sScopePath) {
47: super ();
48: this .m_sScopePath = sScopePath;
49: }
50:
51: /**
52: * Constructs a new scope.
53: *
54: * @param sScopePath Full path to restrict by
55: * @param bIncludeSubDirs true to search all sub-collections
56: */
57: public Scope(String sScopePath, boolean bIncludeSubDirs) {
58: super ();
59: this .m_sScopePath = sScopePath;
60: this .m_bIncludeSubDirs = bIncludeSubDirs;
61: }
62:
63: /**
64: * Returns the full path of the collection.
65: *
66: * @return Full path to restrict by
67: */
68: public String getDir() {
69: return this .m_sScopePath;
70: }
71:
72: /**
73: * Checks if sub-collections are to be searched.
74: *
75: * @return true if sub-collections are to be searched
76: */
77: public boolean includeSubDirs() {
78: return this.m_bIncludeSubDirs;
79: }
80:
81: }
|