From: Svjatoslav Agejenko Date: Tue, 19 Jun 2018 14:56:32 +0000 (+0300) Subject: Improved web indexer. Fixed maven URL. X-Git-Tag: meviz-1.2~29^2 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;ds=sidebyside;h=492279188d6c1b68b37f7d45177916a0d023d954;p=meviz.git Improved web indexer. Fixed maven URL. --- diff --git a/meviz.iml b/meviz.iml index f642318..7399dd5 100644 --- a/meviz.iml +++ b/meviz.iml @@ -1,12 +1,12 @@ - - - - - - + + + + + + diff --git a/pom.xml b/pom.xml index eea9a82..b1cbf6d 100644 --- a/pom.xml +++ b/pom.xml @@ -132,12 +132,12 @@ svjatoslav.eu svjatoslav.eu - scpexe://svjatoslav.eu/var/www/svjatoslav.eu/maven + scpexe://svjatoslav.eu:10006/srv/maven svjatoslav.eu svjatoslav.eu - scpexe://svjatoslav.eu/var/www/svjatoslav.eu/maven + scpexe://svjatoslav.eu:10006/srv/maven diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java index c649d98..dba6f5a 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java @@ -11,7 +11,6 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.UnsupportedEncodingException; import java.net.URL; -import java.net.URLEncoder; import java.util.List; public class WebIndexer extends AbstractIndexer { @@ -35,13 +34,7 @@ public class WebIndexer extends AbstractIndexer { @Override public String getDirectoryUrl(final AbstractFile directory, final IndexingContext context) { - - try { - return jspPath + context.getLocalUrl() + "/" - + URLEncoder.encode(directory.fileName, "UTF-8"); - } catch (final UnsupportedEncodingException e) { - throw new RuntimeException(e); - } + return jspPath + context.getLocalUrl() + "/" + directory.fileName; } public String getHtml(String requestPath) throws diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java index e20f875..55c4e80 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java @@ -189,17 +189,8 @@ public class MixedLayout implements Layout { // assemble final page HTML final StringBuilder html = new StringBuilder(); - if (doHtmlHeaderAndFooter) { - // page header - html.append("\n"); - html.append("\n"); - html.append(" \n"); - html.append("\n"); - html.append("\n"); - html.append("\n"); - html.append("\n"); - html.append("\n"); - } + if (doHtmlHeaderAndFooter) + appendHtmlHeader(html); if (showTitle) html.append("

" + galleryTitle + "

\n"); @@ -210,11 +201,27 @@ public class MixedLayout implements Layout { html.append(filesHtml.toString()); if (doHtmlHeaderAndFooter) - html.append("
\n"); + appendHtmlFooter(html); return html.toString(); } + private void appendHtmlFooter(StringBuilder html) { + html.append("\n"); + } + + private void appendHtmlHeader(StringBuilder html) { + // page header + html.append("\n"); + html.append("\n"); + html.append(" \n"); + html.append("\n"); + html.append("\n"); + html.append("\n"); + html.append("\n"); + html.append("\n"); + } + private String getImageThumbnailUrl(final Picture picture) { final Dimension imageSize = picture.getDimensions();