X-Git-Url: https://git.pterodactylus.net/?p=jSite.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FFileScanner.java;h=04705b52b8a11bff0d4eebb0d2de5802530b2735;hp=1377604d4adec932a1dd16b530dcc85d10bd8cde;hb=cd351fe39bcbc8933187c3864e79e3dc896a374c;hpb=48b6a16c476a1a5b7cd18f100146bebbac0fe3cf diff --git a/src/main/java/de/todesbaum/jsite/gui/FileScanner.java b/src/main/java/de/todesbaum/jsite/gui/FileScanner.java index 1377604..04705b5 100644 --- a/src/main/java/de/todesbaum/jsite/gui/FileScanner.java +++ b/src/main/java/de/todesbaum/jsite/gui/FileScanner.java @@ -44,7 +44,7 @@ import de.todesbaum.jsite.i18n.I18n; * files as an event. * * @see Project#getLocalPath() - * @see FileScannerListener#fileScannerFinished(FileScanner) + * @see FileScannerListener#fileScannerFinished(boolean, java.util.Collection) * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ public class FileScanner implements Runnable { @@ -98,7 +98,7 @@ public class FileScanner implements Runnable { * Scans all available files in the project’s local path and emits an event * when finished. * - * @see FileScannerListener#fileScannerFinished(FileScanner) + * @see FileScannerListener#fileScannerFinished(boolean, java.util.Collection) */ @Override public void run() { @@ -111,7 +111,7 @@ public class FileScanner implements Runnable { } catch (IOException ioe1) { error = true; } - fileScannerListener.fileScannerFinished(this); + fileScannerListener.fileScannerFinished(error, files); } /** @@ -211,95 +211,4 @@ public class FileScanner implements Runnable { return hexString.toString(); } - /** - * Container for a scanned file, consisting of the name of the file and its - * hash. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - public static class ScannedFile implements Comparable { - - /** The name of the file. */ - private final String filename; - - /** The hash of the file. */ - private final String hash; - - /** - * Creates a new scanned file. - * - * @param filename - * The name of the file - * @param hash - * The hash of the file - */ - public ScannedFile(String filename, String hash) { - this.filename = filename; - this.hash = hash; - } - - // - // ACCESSORS - // - - /** - * Returns the name of the file. - * - * @return The name of the file - */ - public String getFilename() { - return filename; - } - - /** - * Returns the hash of the file. - * - * @return The hash of the file - */ - public String getHash() { - return hash; - } - - // - // OBJECT METHODS - // - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return filename.hashCode(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - return filename.equals(obj); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return filename; - } - - // - // COMPARABLE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - public int compareTo(ScannedFile scannedFile) { - return filename.compareTo(scannedFile.filename); - } - - } - }