+ private static final int METADATA_LOAD_TRY_COUNT = 10;
+ private final String globalPrefix;
+ private final String jspPath;
+
+ public WebIndexer(final String globalPrefix, final String jspPath) {
+ this.globalPrefix = globalPrefix;
+ 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() + "/" + directory.fileName;
+ }
+
+ public String getHtml(String requestPath) throws
+ IOException, ClassNotFoundException {
+
+ if (requestPath == null)
+ requestPath = "";
+
+ if (requestPath.equals("/"))
+ requestPath = "";
+
+ final MixedLayout layout = new MixedLayout();
+ final IndexingContext context = new IndexingContext(globalPrefix,
+ requestPath);
+ layout.init("Photos", context.getLocalPathComponents(), this, context);