From: David ‘Bombe’ Roden Date: Sat, 27 Dec 2008 14:02:12 +0000 (+0100) Subject: Treat an empty index file as no index file. X-Git-Tag: 0.7 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a7d90795bb3f97633bdeb0ccc5b060f39f14eb54;p=jSite.git Treat an empty index file as no index file. --- diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index e0ca446..7256bbe 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -394,7 +394,9 @@ public class ProjectInserter implements FileScannerListener, Runnable { int edition = project.getEdition(); String dirURI = "USK@" + project.getInsertURI() + "/" + project.getPath() + "/" + edition + "/"; ClientPutComplexDir putDir = new ClientPutComplexDir("dir-" + counter++, dirURI); - putDir.setDefaultName(project.getIndexFile()); + if ((project.getIndexFile() != null) && (project.getIndexFile().length() > 0)) { + putDir.setDefaultName(project.getIndexFile()); + } putDir.setVerbosity(Verbosity.ALL); putDir.setMaxRetries(-1); for (String filename : files) { diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index 216ee80..75c1453 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -466,7 +466,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.no-node-selected"), null, JOptionPane.ERROR_MESSAGE); return; } - if (project.getIndexFile() == null) { + if ((project.getIndexFile() == null) || (project.getIndexFile().length() == 0)) { if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.empty-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) { return; }