- * Rescans the base path for new or changed files.
- */
- public void rescanBasePath() {
- List<Entry> entries = new ArrayList<Entry>();
- scanPath("", entries);
- }
-
- /**
- * Returns the list of files from the base path.
- *
- * @return The list of files from the base path
- */
- public List<Entry> getBasePathEntries() {
- return basePathEntries;
- }
-
- //
- // PRIVATE METHODS
- //
-
- /**
- * Scans the given path relative to {@link #basePath} for files and adds
- * them to the given list of entries.
- *
- * @param currentPath
- * The current path, relative to the base path
- * @param entries
- * The list of entries
- */
- private void scanPath(String currentPath, List<Entry> entries) {
- File currentDirectory = new File(basePath + File.separatorChar + currentPath);
- if (!currentDirectory.isDirectory()) {
- return;
- }
-
- for (File file: currentDirectory.listFiles()) {
- String fileName = currentPath + File.separatorChar + file.getName();
- if (file.isDirectory()) {
- scanPath(fileName, entries);
- continue;
- }
- PhysicalEntry entry = new PhysicalEntry();
- entry.setName(fileName);
- entry.setPath(file.getPath());
- entry.setInsert(!file.isHidden());
- entries.add(entry);
- }
+ * Adds an override for the given file.
+ *
+ * @param filePath
+ * The file path
+ * @param override
+ * The override for the file
+ */
+ public void addOverride(String filePath, Override override) {
+ overrides.put(filePath, override);
+ }
+
+ /**
+ * Removes the override for the given file.
+ *
+ * @param filePath
+ * The file path for which to remove the override
+ */
+ public void removeOverride(String filePath) {
+ overrides.remove(filePath);
+ }
+
+ /**
+ * Returns the list of {@link Override}s.
+ *
+ * @return All overrides
+ */
+ public Map<String, Override> getOverrides() {
+ return overrides;