You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

FileScanner.java 2.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. package org.apache.tools.ant;
  2. import java.io.*;
  3. /**
  4. * An interface used to describe the actions required by any type of
  5. * directory scanner.
  6. */
  7. public interface FileScanner {
  8. /**
  9. * Adds an array with default exclusions to the current exclusions set.
  10. *
  11. */
  12. public void addDefaultExcludes();
  13. /**
  14. * Gets the basedir that is used for scanning. This is the directory that
  15. * is scanned recursively.
  16. *
  17. * @return the basedir that is used for scanning
  18. */
  19. public File getBasedir();
  20. /**
  21. * Get the names of the directories that matched at least one of the include
  22. * patterns, an matched also at least one of the exclude patterns.
  23. * The names are relative to the basedir.
  24. *
  25. * @return the names of the directories
  26. */
  27. public String[] getExcludedDirectories();
  28. /**
  29. * Get the names of the files that matched at least one of the include
  30. * patterns, an matched also at least one of the exclude patterns.
  31. * The names are relative to the basedir.
  32. *
  33. * @return the names of the files
  34. */
  35. public String[] getExcludedFiles();
  36. /**
  37. * Get the names of the directories that matched at least one of the include
  38. * patterns, an matched none of the exclude patterns.
  39. * The names are relative to the basedir.
  40. *
  41. * @return the names of the directories
  42. */
  43. public String[] getIncludedDirectories();
  44. /**
  45. * Get the names of the files that matched at least one of the include
  46. * patterns, an matched none of the exclude patterns.
  47. * The names are relative to the basedir.
  48. *
  49. * @return the names of the files
  50. */
  51. public String[] getIncludedFiles();
  52. /**
  53. * Get the names of the directories that matched at none of the include
  54. * patterns.
  55. * The names are relative to the basedir.
  56. *
  57. * @return the names of the directories
  58. */
  59. public String[] getNotIncludedDirectories();
  60. /**
  61. * Get the names of the files that matched at none of the include patterns.
  62. * The names are relative to the basedir.
  63. *
  64. * @return the names of the files
  65. */
  66. public String[] getNotIncludedFiles();
  67. /**
  68. * Scans the base directory for files that match at least one include
  69. * pattern, and don't match any exclude patterns.
  70. *
  71. * @exception IllegalStateException when basedir was set incorrecly
  72. */
  73. public void scan();
  74. /**
  75. * Sets the basedir for scanning. This is the directory that is scanned
  76. * recursively.
  77. *
  78. * @param basedir the (non-null) basedir for scanning
  79. */
  80. public void setBasedir(String basedir);
  81. /**
  82. * Sets the basedir for scanning. This is the directory that is scanned
  83. * recursively.
  84. *
  85. * @param basedir the basedir for scanning
  86. */
  87. public void setBasedir(File basedir);
  88. /**
  89. * Sets the set of exclude patterns to use.
  90. *
  91. * @param excludes list of exclude patterns
  92. */
  93. public void setExcludes(String[] excludes);
  94. /**
  95. * Sets the set of include patterns to use.
  96. *
  97. * @param includes list of include patterns
  98. */
  99. public void setIncludes(String[] includes);
  100. }