Unify copyright file headers, update years to include 2011.
[jSite.git] / src / de / todesbaum / jsite / gui / FileScanner.java
index b699ebb..ede930d 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * 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
@@ -32,7 +31,7 @@ import de.todesbaum.jsite.i18n.I18n;
 /**
  * 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>
@@ -53,7 +52,7 @@ public class FileScanner implements Runnable {
 
        /**
         * Creates a new file scanner for the given project.
-        * 
+        *
         * @param project
         *            The project whose files to scan
         */
@@ -63,7 +62,7 @@ public class FileScanner implements Runnable {
 
        /**
         * Adds the given listener to the list of listeners.
-        * 
+        *
         * @param fileScannerListener
         *            The listener to add
         */
@@ -73,7 +72,7 @@ public class FileScanner implements Runnable {
 
        /**
         * Removes the given listener from the list of listeners.
-        * 
+        *
         * @param fileScannerListener
         *            The listener to remove
         */
@@ -95,7 +94,7 @@ public class FileScanner implements Runnable {
         * <p>
         * Scans all available files in the project’s local path and emits an event
         * when finished.
-        * 
+        *
         * @see FileScannerListener#fileScannerFinished(FileScanner)
         */
        public void run() {
@@ -112,7 +111,7 @@ public class FileScanner implements Runnable {
 
        /**
         * Returns whether there was an error scanning for files.
-        * 
+        *
         * @return <code>true</code> if there was an error, <code>false</code>
         *         otherwise
         */
@@ -122,7 +121,7 @@ public class FileScanner implements Runnable {
 
        /**
         * Returns the list of found files.
-        * 
+        *
         * @return The list of found files
         */
        public List<String> getFiles() {
@@ -131,7 +130,7 @@ public class FileScanner implements Runnable {
 
        /**
         * Recursively scans a directory and adds all found files to the given list.
-        * 
+        *
         * @param rootDir
         *            The directory to scan
         * @param fileList
@@ -142,8 +141,9 @@ public class FileScanner implements Runnable {
        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) {