added support for single file websites

This commit is contained in:
kennycud 2025-06-17 15:09:11 -07:00
parent 5b402e0bca
commit a3bb6638bf

View File

@ -62,7 +62,17 @@ public enum Service {
// Custom validation function to require an index HTML file in the root directory // Custom validation function to require an index HTML file in the root directory
List<String> fileNames = ArbitraryDataRenderer.indexFiles(); List<String> fileNames = ArbitraryDataRenderer.indexFiles();
String[] files = path.toFile().list(); List<String> files;
// single files are paackaged differently
if( path.toFile().isFile() ) {
files = new ArrayList<>(1);
files.add(path.getFileName().toString());
}
else {
files = new ArrayList<>(Arrays.asList(path.toFile().list()));
}
if (files != null) { if (files != null) {
for (String file : files) { for (String file : files) {
Path fileName = Paths.get(file).getFileName(); Path fileName = Paths.get(file).getFileName();