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 {
+ if (requestPath == null)
+ requestPath = "";
+
if (requestPath.equals("/"))
requestPath = "";
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)