PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 85 lines | 40 code | 9 blank | 36 comment | 0 complexity | e9e9484ba2ca04e16ad403ead48e8f11 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. package org.gjt.sp.jedit.search;
  23. //{{{ Imports
  24. import gnu.regexp.RE;
  25. import java.io.*;
  26. import java.util.Vector;
  27. import org.gjt.sp.jedit.*;
  28. import org.gjt.sp.util.Log;
  29. //}}}
  30. /**
  31. * Recursive directory search.
  32. * @author Slava Pestov
  33. * @version $Id: DirectoryListSet.java 3931 2001-12-02 11:40:51Z spestov $
  34. */
  35. public class DirectoryListSet extends BufferListSet
  36. {
  37. //{{{ DirectoryListSet constructor
  38. public DirectoryListSet(String directory, String glob, boolean recurse)
  39. {
  40. this.directory = directory;
  41. this.glob = glob;
  42. this.recurse = recurse;
  43. } //}}}
  44. //{{{ getDirectory() method
  45. public String getDirectory()
  46. {
  47. return directory;
  48. } //}}}
  49. //{{{ getFileFilter() method
  50. public String getFileFilter()
  51. {
  52. return glob;
  53. } //}}}
  54. //{{{ isRecursive() method
  55. public boolean isRecursive()
  56. {
  57. return recurse;
  58. } //}}}
  59. //{{{ getCode() method
  60. public String getCode()
  61. {
  62. return "new DirectoryListSet(\"" + MiscUtilities.charsToEscapes(directory)
  63. + "\",\"" + MiscUtilities.charsToEscapes(glob) + "\","
  64. + recurse + ")";
  65. } //}}}
  66. //{{{ _getFiles() method
  67. protected String[] _getFiles()
  68. {
  69. return MiscUtilities.listDirectory(directory,glob,recurse);
  70. } //}}}
  71. //{{{ Private members
  72. private String directory;
  73. private String glob;
  74. private boolean recurse;
  75. //}}}
  76. }