Skip to content
Snippets Groups Projects

F filesystem response url

Merged Timm Fitschen requested to merge f-filesystem-response-url into dev
Files
4
@@ -86,14 +86,16 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
@@ -86,14 +86,16 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
}
}
if (file.isDirectory()) {
if (file.isDirectory()) {
String referenceString = getReference().toString();
String path = (specifier.endsWith("/") ? specifier : specifier + "/");
if (!referenceString.endsWith("/")) {
String url =
referenceString = referenceString + "/";
getUtils().getServerRootURI()
}
+ "/FileSystem"
 
+ (path.startsWith("/") ? path : ("/" + path));
 
final Element folder = new Element("dir");
final Element folder = new Element("dir");
folder.setAttribute("path", (specifier.endsWith("/") ? specifier : specifier + "/"));
folder.setAttribute("path", path);
folder.setAttribute("name", file.getName());
folder.setAttribute("name", file.getName());
folder.setAttribute("url", referenceString);
folder.setAttribute("url", url);
final boolean thumbnailsExist =
final boolean thumbnailsExist =
new File(file.getAbsolutePath() + File.separator + ".thumbnails").exists();
new File(file.getAbsolutePath() + File.separator + ".thumbnails").exists();
@@ -110,7 +112,7 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
@@ -110,7 +112,7 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
}
}
if (thumbnailsExist) {
if (thumbnailsExist) {
final Attribute thumbnailAttribute = getThumbnailAttribute(file, child, referenceString);
final Attribute thumbnailAttribute = getThumbnailAttribute(file, child, url);
if (thumbnailAttribute != null) {
if (thumbnailAttribute != null) {
celem.setAttribute(thumbnailAttribute);
celem.setAttribute(thumbnailAttribute);
}
}
Loading