Skip to content
Snippets Groups Projects
Commit af113ab6 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Length property must be always present

parent f0b2fe89
No related branches found
No related tags found
No related merge requests found
......@@ -187,8 +187,9 @@ public class NodeDAO {
List<Property> properties = new ArrayList<>();
addProperty(NodeProperties.LENGTH_URI, rs.getString("content_length"),
properties);
// Content length is required for CADC client compatibility
String contentLength = rs.getString("content_length");
addProperty(NodeProperties.LENGTH_URI, contentLength == null ? "0" : contentLength, properties);
String creationTime = rs.getString("created_on").replace(" ", "T");
......
......@@ -59,7 +59,8 @@ public class NodeDAOTest {
ContainerNode root = (ContainerNode) dao.listNode("/").get();
assertEquals(2, root.getNodes().size());
assertEquals("true", NodeProperties.getNodePropertyAsListByURI(root, NodeProperties.PUBLIC_READ_URI).get(0));
assertEquals("true", NodeProperties.getNodePropertyByURI(root, NodeProperties.PUBLIC_READ_URI));
assertEquals("0", NodeProperties.getNodePropertyByURI(root, NodeProperties.LENGTH_URI));
assertEquals("group1 group2", NodeProperties.getNodePropertyByURI(root.getNodes().get(0), NodeProperties.GROUP_READ_URI));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment