Skip to content
Snippets Groups Projects
Commit 63188fc7 authored by Daniel's avatar Daniel
Browse files

DOC, FIX: Using canonical path in Info.java, more documentation.

parent c929d252
No related branches found
No related tags found
No related merge requests found
......@@ -331,6 +331,7 @@ public abstract class AbstractCaosDBServerResource extends ServerResource {
this.xslScript = s;
}
/** Wrap an element for an "OK" response. */
protected JdomRepresentation ok(Element root) {
return ok(new Document(root));
}
......
......@@ -30,9 +30,8 @@ import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.restlet.representation.Representation;
import org.restlet.resource.Options;
/** This class represents the information retrieved by the /Info GET request to CaosDB. */
/** This class represents the information retrieved by /Info requests (only GET) to CaosDB. */
public class InfoResource extends AbstractCaosDBServerResource {
/**
......
......@@ -105,6 +105,7 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
* @return A linked list containing XML elements. The path attribute of these elements is set to
* the absolute path of the filenames where the path to the drop off box is removed at the
* beginning.
* @fixme Should check if the files are inside the DropOffBox path.
*/
private static LinkedList<Element> getFlatList(final File[] files) {
try {
......@@ -115,7 +116,7 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
} else {
final Element element = new Element("file");
final String tempPath =
file.getAbsolutePath().substring(dropOffBox.getCanonicalPath().length() + 1);
file.getCanonicalPath().substring(dropOffBox.getCanonicalPath().length() + 1);
element.setAttribute("path", tempPath);
ret.add(element);
}
......@@ -212,7 +213,7 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
// TODO: return a message that the DropOffBox is not readable.
}
} else {
// TODO: This function should at least return a message that the DropOffBox is diabled or not
// TODO: This function should at least return a message that the DropOffBox is disabled or not
// present.
}
info.addContent(counts);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment