Allow more content types than HTML for the index file.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 13 Jan 2010 20:52:27 +0000 (21:52 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 13 Jan 2010 20:52:27 +0000 (21:52 +0100)
src/de/todesbaum/jsite/main/Main.java

index 9f21042..f59e29c 100644 (file)
@@ -24,8 +24,10 @@ import java.awt.event.ActionListener;
 import java.io.File;
 import java.io.IOException;
 import java.text.MessageFormat;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
@@ -530,7 +532,8 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                                        return;
                                }
                        }
-                       if (hasIndexFile && !project.getFileOption(indexFile).getMimeType().equals("text/html")) {
+                       List<String> allowedIndexContentTypes = Arrays.asList("text/html", "application/xhtml+xml");
+                       if (hasIndexFile && !allowedIndexContentTypes.contains(project.getFileOption(indexFile).getMimeType())) {
                                if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.index-not-html"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
                                        return;
                                }