PageRenderTime 89ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 37ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre5/org/gjt/sp/jedit/search/DirectoryListSet.java

#
Java | 85 lines | 40 code | 9 blank | 36 comment | 0 complexity | e9e9484ba2ca04e16ad403ead48e8f11 MD5 | raw file
 1/*
 2 * DirectoryListSet.java - Directory list matcher
 3 * :tabSize=8:indentSize=8:noTabs=false:
 4 * :folding=explicit:collapseFolds=1:
 5 *
 6 * Copyright (C) 1999, 2000, 2001 Slava Pestov
 7 *
 8 * This program is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 */
22
23package org.gjt.sp.jedit.search;
24
25//{{{ Imports
26import gnu.regexp.RE;
27import java.io.*;
28import java.util.Vector;
29import org.gjt.sp.jedit.*;
30import org.gjt.sp.util.Log;
31//}}}
32
33/**
34 * Recursive directory search.
35 * @author Slava Pestov
36 * @version $Id: DirectoryListSet.java 3931 2001-12-02 11:40:51Z spestov $
37 */
38public class DirectoryListSet extends BufferListSet
39{
40	//{{{ DirectoryListSet constructor
41	public DirectoryListSet(String directory, String glob, boolean recurse)
42	{
43		this.directory = directory;
44		this.glob = glob;
45		this.recurse = recurse;
46	} //}}}
47
48	//{{{ getDirectory() method
49	public String getDirectory()
50	{
51		return directory;
52	} //}}}
53
54	//{{{ getFileFilter() method
55	public String getFileFilter()
56	{
57		return glob;
58	} //}}}
59
60	//{{{ isRecursive() method
61	public boolean isRecursive()
62	{
63		return recurse;
64	} //}}}
65
66	//{{{ getCode() method
67	public String getCode()
68	{
69		return "new DirectoryListSet(\"" + MiscUtilities.charsToEscapes(directory)
70			+ "\",\"" + MiscUtilities.charsToEscapes(glob) + "\","
71			+ recurse + ")";
72	} //}}}
73
74	//{{{ _getFiles() method
75	protected String[] _getFiles()
76	{
77		return MiscUtilities.listDirectory(directory,glob,recurse);
78	} //}}}
79
80	//{{{ Private members
81	private String directory;
82	private String glob;
83	private boolean recurse;
84	//}}}
85}