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

Commit 8b6ff17

Browse files
author
Rob Rudin
committed
#53 Extracted "/" as uriPrefix
1 parent 535cd88 commit 8b6ff17

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
group=com.marklogic
22
javadocsDir=../gh-pages-marklogic-java/javadocs
3-
version=2.12.1
3+
version=2.13.DEV

src/main/java/com/marklogic/client/file/DefaultDocumentFileReader.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class DefaultDocumentFileReader extends LoggingObject implements FileVisi
2020
private List<FileFilter> fileFilters;
2121
private List<DocumentFile> documentFiles;
2222
private List<DocumentFileProcessor> documentFileProcessors;
23+
private String uriPrefix = "/";
2324

2425
public DefaultDocumentFileReader() {
2526
initialize();
@@ -107,7 +108,10 @@ protected boolean acceptPath(Path path, BasicFileAttributes attrs) {
107108

108109
protected DocumentFile buildDocumentFile(Path path, Path currentRootPath) {
109110
Path relPath = currentRootPath.relativize(path);
110-
String uri = "/" + relPath.toString().replace("\\", "/");
111+
String uri = relPath.toString().replace("\\", "/");
112+
if (uriPrefix != null) {
113+
uri = uriPrefix + uri;
114+
}
111115
File f = path.toFile();
112116
return new DocumentFile(uri, f);
113117
}
@@ -172,4 +176,8 @@ public List<FileFilter> getFileFilters() {
172176
public void setFileFilters(List<FileFilter> fileFilters) {
173177
this.fileFilters = fileFilters;
174178
}
179+
180+
public void setUriPrefix(String uriPrefix) {
181+
this.uriPrefix = uriPrefix;
182+
}
175183
}

0 commit comments

Comments
 (0)