Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
#53 Extracted "/" as uriPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Rudin committed Feb 22, 2017
1 parent 535cd88 commit 8b6ff17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.marklogic
javadocsDir=../gh-pages-marklogic-java/javadocs
version=2.12.1
version=2.13.DEV
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class DefaultDocumentFileReader extends LoggingObject implements FileVisi
private List<FileFilter> fileFilters;
private List<DocumentFile> documentFiles;
private List<DocumentFileProcessor> documentFileProcessors;
private String uriPrefix = "/";

public DefaultDocumentFileReader() {
initialize();
Expand Down Expand Up @@ -107,7 +108,10 @@ protected boolean acceptPath(Path path, BasicFileAttributes attrs) {

protected DocumentFile buildDocumentFile(Path path, Path currentRootPath) {
Path relPath = currentRootPath.relativize(path);
String uri = "/" + relPath.toString().replace("\\", "/");
String uri = relPath.toString().replace("\\", "/");
if (uriPrefix != null) {
uri = uriPrefix + uri;
}
File f = path.toFile();
return new DocumentFile(uri, f);
}
Expand Down Expand Up @@ -172,4 +176,8 @@ public List<FileFilter> getFileFilters() {
public void setFileFilters(List<FileFilter> fileFilters) {
this.fileFilters = fileFilters;
}

public void setUriPrefix(String uriPrefix) {
this.uriPrefix = uriPrefix;
}
}

0 comments on commit 8b6ff17

Please sign in to comment.