Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit c3dd1a8

Browse files
author
Pavel-Teplitsky
committed
Added default document feature
1 parent 758fa9e commit c3dd1a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/com/aliensoft/quickview/resources/QuickViewResource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import java.net.UnknownHostException;
4848
import java.net.URL;
4949
import java.nio.file.Files;
50+
import java.nio.file.Paths;
5051
import java.nio.file.StandardCopyOption;
5152
import java.util.ArrayList;
5253

@@ -163,6 +164,10 @@ public Object loadDocumentDescription(@Context HttpServletRequest request, @Cont
163164
String requestBody = getRequestBody(request);
164165
// get/set parameters
165166
String documentGuid = getJsonString(requestBody, "guid");
167+
// check if documentGuid contains path or only file name
168+
if(!Paths.get(documentGuid).isAbsolute()){
169+
documentGuid = quickViewConfig.getApplication().getFilesDirectory() + "/" + documentGuid;
170+
}
166171
// get document info options
167172
DocumentInfoOptions documentInfoOptions = new DocumentInfoOptions(documentGuid);
168173
// get document info container

0 commit comments

Comments
 (0)