From: David ‘Bombe’ Roden Date: Thu, 22 Mar 2012 20:12:37 +0000 (+0100) Subject: Use last insert filename when redirecting to a previously inserted file. X-Git-Tag: 0.10^2~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bd6fc33935e9a2afe48e9ff248ba63188bcd5470;p=jSite.git Use last insert filename when redirecting to a previously inserted file. --- diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index 1f5e8ef..3a49c49 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -326,7 +326,7 @@ public class ProjectInserter implements FileScannerListener, Runnable { if (!fileOption.isForceInsert() && file.getHash().equals(fileOption.getLastInsertHash())) { /* only insert a redirect. */ logger.log(Level.FINE, String.format("Inserting redirect to edition %d for %s.", fileOption.getLastInsertEdition(), filename)); - return new RedirectFileEntry(filename, fileOption.getMimeType(), "SSK@" + project.getRequestURI() + "/" + project.getPath() + "-" + fileOption.getLastInsertEdition() + "/" + filename); + return new RedirectFileEntry(fileOption.hasChangedName() ? fileOption.getChangedName() : filename, fileOption.getMimeType(), "SSK@" + project.getRequestURI() + "/" + project.getPath() + "-" + fileOption.getLastInsertEdition() + "/" + fileOption.getLastInsertFilename()); } try { long[] fileLength = new long[1];