From e9b1a95042624fac8e08631a4655984a15416413 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 2 Feb 2015 19:45:18 +0100 Subject: [PATCH] Use correct name of index file if it has been renamed. --- src/main/java/de/todesbaum/jsite/application/ProjectInserter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java b/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java index 709f557..35a2452 100644 --- a/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java @@ -365,7 +365,13 @@ public class ProjectInserter implements FileScannerListener, Runnable { String dirURI = "USK@" + project.getInsertURI() + "/" + project.getPath() + "/" + edition + "/"; ClientPutComplexDir putDir = new ClientPutComplexDir("dir-" + counter++, dirURI, tempDirectory); if ((project.getIndexFile() != null) && (project.getIndexFile().length() > 0)) { - putDir.setDefaultName(project.getIndexFile()); + FileOption indexFileOption = project.getFileOption(project.getIndexFile()); + Optional changedName = indexFileOption.getChangedName(); + if (changedName.isPresent()) { + putDir.setDefaultName(changedName.get()); + } else { + putDir.setDefaultName(project.getIndexFile()); + } } putDir.setVerbosity(Verbosity.ALL); putDir.setMaxRetries(-1); -- 2.7.4