From 70be82588445ab81b6f1b64537c65bb5dac2b1d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 28 Aug 2012 14:13:16 +0200 Subject: [PATCH] Expose the last scanned filename. --- src/main/java/de/todesbaum/jsite/gui/FileScanner.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/de/todesbaum/jsite/gui/FileScanner.java b/src/main/java/de/todesbaum/jsite/gui/FileScanner.java index cfb0c23..d86a6ba 100644 --- a/src/main/java/de/todesbaum/jsite/gui/FileScanner.java +++ b/src/main/java/de/todesbaum/jsite/gui/FileScanner.java @@ -63,6 +63,9 @@ public class FileScanner implements Runnable { /** Wether there was an error. */ private boolean error = false; + /** The name of the last file scanned. */ + private String lastFilename; + /** * Creates a new file scanner for the given project. * @@ -103,6 +106,16 @@ public class FileScanner implements Runnable { } /** + * Returns the name of the last file scanned. + * + * @return The name of the last file scanned, or {@code null} if there was + * no file scanned yet + */ + public String getLastFilename() { + return lastFilename; + } + + /** * {@inheritDoc} *

* Scans all available files in the project’s local path and emits an event @@ -114,6 +127,7 @@ public class FileScanner implements Runnable { public void run() { files = new ArrayList(); error = false; + lastFilename = null; try { scanFiles(new File(project.getLocalPath()), files); Collections.sort(files); @@ -172,6 +186,7 @@ public class FileScanner implements Runnable { String filename = project.shortenFilename(file).replace('\\', '/'); String hash = hashFile(project.getLocalPath(), filename); fileList.add(new ScannedFile(filename, hash)); + lastFilename = filename; } } -- 2.7.4