use latest svjatoslavcommons
[meviz.git] / src / main / java / eu / svjatoslav / meviz / htmlindexer / layouts / MixedLayout.java
index f721ba6..cf1285e 100755 (executable)
@@ -16,11 +16,11 @@ import java.util.List;
 import org.apache.log4j.Logger;
 
 import eu.svjatoslav.commons.file.FilePathParser;
-import eu.svjatoslav.commons.network.UrlParamEncoder;
 import eu.svjatoslav.meviz.htmlindexer.AbstractIndexer;
 import eu.svjatoslav.meviz.htmlindexer.Constants;
 import eu.svjatoslav.meviz.htmlindexer.IndexingContext;
 import eu.svjatoslav.meviz.htmlindexer.Layout;
+import eu.svjatoslav.meviz.htmlindexer.Utils;
 import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension;
 import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata;
 import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile;
@@ -64,7 +64,7 @@ public class MixedLayout implements Layout {
 
                filesHtml.append("<div style=\"clear: both;\"><a href=\""
                                + indexingContext.getGlobalUrl()
-                               + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+                               + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
                                                + fullFileName) + "\">" + fullFileName + "</a>\n");
                filesHtml.append("&nbsp;&nbsp;("
                                + FilePathParser.getFileSizeDescription(file.getFileLength())
@@ -115,8 +115,9 @@ public class MixedLayout implements Layout {
                // clickable image thumbnail
                filesHtml.append("<a href=\""
                                + indexingContext.getGlobalUrl()
-                               + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+                               + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
                                                + picture.fileName) + "\">\n");
+
                filesHtml.append("<img border=\"0\" src=\""
                                + getImageThumbnailUrl(picture) + "\"/></a><br/>\n");
 
@@ -147,8 +148,8 @@ public class MixedLayout implements Layout {
                filesHtml
                                .append("<source type=\"video/ogg\" codecs=\"theora, vorbis\" src=\""
                                                + indexingContext.getGlobalUrl()
-                                               + UrlParamEncoder.encode(indexingContext.getLocalUrl()
-                                                               + "/" + file.fileName) + "\">\n");
+                                               + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+                                                               + file.fileName) + "\">\n");
                filesHtml.append("</source>\n");
                filesHtml.append("</video>\n");
                filesHtml.append("<br/>\n");
@@ -163,7 +164,7 @@ public class MixedLayout implements Layout {
                // video download link
                filesHtml.append("<a href=\""
                                + indexingContext.getGlobalUrl()
-                               + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+                               + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
                                                + file.fileName) + "\">download as OGV file</a>");
 
                filesHtml.append("</div>\n");
@@ -282,7 +283,7 @@ public class MixedLayout implements Layout {
                // watchable video
 
                String fileUrl = indexingContext.getGlobalUrl()
-                               + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+                               + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
                                                + file.fileName);
 
                filesHtml.append("<video controls>\n");
@@ -301,7 +302,7 @@ public class MixedLayout implements Layout {
                // video download link
                filesHtml.append("<a href=\""
                                + indexingContext.getGlobalUrl()
-                               + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+                               + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
                                                + file.fileName) + "\">download as WebM file</a>");
 
                filesHtml.append("</div>\n");