From: David ‘Bombe’ Roden Date: Tue, 28 Aug 2012 12:13:16 +0000 (+0200) Subject: Expose the last scanned filename. X-Git-Tag: 0.11^2~17 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=70be82588445ab81b6f1b64537c65bb5dac2b1d2;hp=967018cd81182ec2fd4f941e271137aadbaa6d81;p=jSite.git Expose the last scanned filename. --- 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; } }