Skip to content
Snippets Groups Projects
Commit c4a73138 authored by buczekp's avatar buczekp
Browse files

[LMS-2104] minor: evaluate estimated size of virtual data set

SVN: 21378
parent 912abebf
No related branches found
No related tags found
No related merge requests found
......@@ -316,7 +316,21 @@ public class VirtualHierarchicalContent implements IHierarchicalContent
public long getFileLength() throws UnsupportedOperationException
{
return lastExistingNode().getFileLength();
if (isDirectory())
{
// For directory we return an estimated length - sum of lengths of all nodes.
// NOTE: This code is here for future. Currently all implementations for real data
// set directories throw an exception when asked for file length.
long estimatedLength = 0;
for (IHierarchicalContentNode node : nodes)
{
estimatedLength += node.getFileLength();
}
return estimatedLength;
} else
{
return lastExistingNode().getFileLength();
}
}
public IRandomAccessFile getFileContent() throws UnsupportedOperationException,
......
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