Skip to content
Snippets Groups Projects
Verified Commit 489827b2 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: cleanup

parent 4e32b1c8
No related branches found
No related tags found
No related merge requests found
package org.caosdb.server.database.proto;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
/**
* This class is a flat, data-only representation of a single item of version information. This
* class is an intermediate representation which abstracts away the data base results and comes in a
* form which is easily cacheable.
*
* @author Timm Fitschen (t.fitschen@indiscale.com)
*/
public class VersionHistoryItem implements Serializable {
private static final long serialVersionUID = 428030617967255942L;
public String id = null;
public LinkedList<String> parents = null;
public List<String> parents = null;
public Long seconds = null;
public Integer nanos = null;
public String username = null;
......
......@@ -202,10 +202,6 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
}
dropOffBox = new File(FileSystem.getDropOffBox());
final Element info = new Element("Stats");
if (CaosDBServer.isDebugMode()) {
info.setAttribute("debug", "true");
}
final Element counts = new Element("counts");
counts.setAttribute("records", Integer.toString(recordsCount));
counts.setAttribute("properties", Integer.toString(propertiesCount));
......@@ -213,16 +209,18 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
counts.setAttribute("files", Integer.toString(filesCount));
counts.setAttribute("fssize", fssize);
counts.setAttribute("tmpfiles", Integer.toString(tmpFilesCount));
final Element dropOffBoxElem = new Element("dropOffBox");
if (CaosDBServer.isDebugMode()) {
counts.setAttribute("debug", "true");
}
final Element e = new Element("dropOffBox");
if (dropOffBox.isDirectory()) {
if (dropOffBox.canRead()) {
if (tree) {
dropOffBoxElem.setAttribute("path", dropOffBox.getAbsolutePath());
dropOffBoxElem.addContent(getTree(dropOffBox.listFiles()));
e.setAttribute("path", dropOffBox.getAbsolutePath());
e.addContent(getTree(dropOffBox.listFiles()));
} else {
dropOffBoxElem.setAttribute("path", dropOffBox.getAbsolutePath());
dropOffBoxElem.addContent(getFlatList(dropOffBox.listFiles()));
e.setAttribute("path", dropOffBox.getAbsolutePath());
e.addContent(getFlatList(dropOffBox.listFiles()));
}
} else {
// TODO: return a message that the DropOffBox is not readable.
......@@ -232,7 +230,7 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
// present.
}
info.addContent(counts);
info.addContent(dropOffBoxElem);
info.addContent(e);
return info;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment