From: David ‘Bombe’ Roden Date: Thu, 22 Mar 2012 20:10:46 +0000 (+0100) Subject: Use changed name when inserting a file. X-Git-Tag: 0.10^2~14 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3c1268861fad63a64a21fc2d46041ca736e48be9;p=jSite.git Use changed name when inserting a file. --- diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index d16be3e..1f5e8ef 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -331,13 +331,13 @@ public class ProjectInserter implements FileScannerListener, Runnable { try { long[] fileLength = new long[1]; InputStream fileEntryInputStream = createFileInputStream(filename, fileOption, edition, fileLength); - fileEntry = new DirectFileEntry(filename, fileOption.getMimeType(), fileEntryInputStream, fileLength[0]); + fileEntry = new DirectFileEntry(fileOption.hasChangedName() ? fileOption.getChangedName() : filename, fileOption.getMimeType(), fileEntryInputStream, fileLength[0]); } catch (IOException ioe1) { /* ignore, null is returned. */ } } else { if (fileOption.isInsertRedirect()) { - fileEntry = new RedirectFileEntry(filename, fileOption.getMimeType(), fileOption.getCustomKey()); + fileEntry = new RedirectFileEntry(fileOption.hasChangedName() ? fileOption.getChangedName() : filename, fileOption.getMimeType(), fileOption.getCustomKey()); } } return fileEntry;