X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FFileScanner.java;h=d86a6ba69e06f3d610eae7a706344a707fba97cf;hb=b084107c9af548804c526711b4e49e1b65c82f7a;hp=cfb0c238a286685fe9106caec9bbd22432dc2f0d;hpb=967018cd81182ec2fd4f941e271137aadbaa6d81;p=jSite.git 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; } }