X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fmeviz%2Fhtmlindexer%2FWebIndexer.java;h=acc1a28ad350636a7b21b0056f7936b06bf4ea09;hb=bc2cdc4cc3316a5fb66f4372e3708b610c8f68b0;hp=199f789e3dc517d087b1ec9107eb9e6930ca96c6;hpb=cae31cf3d6924dfbd3fe73a6f0f954b01d96bea2;p=meviz.git diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java index 199f789..acc1a28 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java @@ -33,7 +33,10 @@ public class WebIndexer extends AbstractIndexer { } public String getHtml(String requestPath) throws MalformedURLException, - IOException, ClassNotFoundException { + IOException, ClassNotFoundException { + + if (requestPath == null) + requestPath = ""; if (requestPath.equals("/")) requestPath = ""; @@ -43,11 +46,11 @@ public class WebIndexer extends AbstractIndexer { requestPath); layout.init("Photos", context.getLocalPathComponents(), this, context); - final DirectoryMetadata metadata = getMetadataForPath(requestPath); + final DirectoryMetadata directory = getMetadataForPath(requestPath); - compileHtml(layout, metadata); + compileHtml(layout, directory); - return layout.getHtml(false, false); + return layout.getHtml(false, false, directory); } public DirectoryMetadata getMetadataForPath(final String requestPath) @@ -107,14 +110,14 @@ public class WebIndexer extends AbstractIndexer { // file path if (picture.getDimensions().equals(desiredDimension)) return context.getGlobalUrl() + context.getLocalUrl() + "/" - + picture.fileName; + + picture.fileName; final String thumbnailFileName = picture .getRelativeThumbnailFileName(desiredDimension); return context.getGlobalUrl() + context.getLocalUrl() + "/" - + Constants.THUMBNAILS_DIRECTORY_NAME + "/" - + UrlParamEncoder.encode(thumbnailFileName); + + Constants.THUMBNAILS_DIRECTORY_NAME + "/" + + UrlParamEncoder.encode(thumbnailFileName); } }