import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLEncoder;
import java.util.List;
import eu.svjatoslav.commons.network.UrlParamEncoder;
this.jspPath = jspPath;
}
+ @Override
+ public void compileHtml(final Layout layout,
+ final DirectoryMetadata directory)
+ throws UnsupportedEncodingException {
+ super.compileHtml(layout, directory);
+ }
+
@Override
public String getDirectoryUrl(final AbstractFile directory,
final IndexingContext context) {
- return jspPath + context.getLocalUrl() + "/"
- + UrlParamEncoder.encode(directory.fileName);
+
+ try {
+ return jspPath + context.getLocalUrl() + "/"
+ + URLEncoder.encode(directory.fileName, "UTF-8");
+ } catch (final UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
}
public String getHtml(String requestPath) throws MalformedURLException,
- IOException, ClassNotFoundException {
+ IOException, ClassNotFoundException {
if (requestPath == null)
requestPath = "";
// 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);
}
}