/*
- * jSite - a tool for uploading websites into Freenet
- * Copyright (C) 2006 David Roden
+ * jSite - FileScanner.java - Copyright © 2006–2011 David Roden
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**
* Scans the local path of a project anychronously and returns the list of found
* files as an event.
- *
+ *
* @see Project#getLocalPath()
* @see FileScannerListener#fileScannerFinished(FileScanner)
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
/**
* Creates a new file scanner for the given project.
- *
+ *
* @param project
* The project whose files to scan
*/
/**
* Adds the given listener to the list of listeners.
- *
+ *
* @param fileScannerListener
* The listener to add
*/
/**
* Removes the given listener from the list of listeners.
- *
+ *
* @param fileScannerListener
* The listener to remove
*/
* <p>
* Scans all available files in the project’s local path and emits an event
* when finished.
- *
+ *
* @see FileScannerListener#fileScannerFinished(FileScanner)
*/
public void run() {
/**
* Returns whether there was an error scanning for files.
- *
+ *
* @return <code>true</code> if there was an error, <code>false</code>
* otherwise
*/
/**
* Returns the list of found files.
- *
+ *
* @return The list of found files
*/
public List<String> getFiles() {
/**
* Recursively scans a directory and adds all found files to the given list.
- *
+ *
* @param rootDir
* The directory to scan
* @param fileList
private void scanFiles(File rootDir, List<String> fileList) throws IOException {
File[] files = rootDir.listFiles(new FileFilter() {
+ @SuppressWarnings("synthetic-access")
public boolean accept(File file) {
- return !file.isHidden();
+ return !project.isIgnoreHiddenFiles() || !file.isHidden();
}
});
if (files == null) {