@Produces("text/plain")
public Response usageListing(UsageListingRequest usageListingRequest) throws Exception
{
context.getExhibitor().getLog().add(ActivityLog.Type.INFO, "Starting usage listing");
final UsageListing usageListing = new UsageListing(context.getExhibitor(), usageListingRequest.getStartPath(), usageListingRequest.getMaxChildrenForTraversal());
usageListing.generate();
final PipedInputStream in = new PipedInputStream();
final PipedOutputStream pipedOutputStream = new PipedOutputStream(in);
executorService.submit
(
new Runnable()
{
@Override
public void run()
{
PrintStream out = null;
try
{
out = new PrintStream(pipedOutputStream);
out.println("Path\tCreateDate\tChildQty\tDeepChildQty");
Iterator<String> iterator = usageListing.getPaths();
while ( iterator.hasNext() )
{
String path = iterator.next();
UsageListing.NodeEntry details = usageListing.getNodeDetails(path);
out.println(path + "\t" + details.getCreationDate() + "\t" + details.getDirectChildQty() + "\t" + details.getDeepChildQty());
}
}
catch ( Exception e )
{