protected void listFiles(final String[] args) throws DBException
 {
  PrintStream out = getOutputStream();
  SharedFiles query = new SharedFiles(db, getConfiguration());
  ListFilesPredicate predicate = null;
  Timestamp[] limits = { null, null };
  if (null != args && 0 < args.length)
   try
   {
    predicate = ListFilesPredicate.valueOf(args[0].toUpperCase());
    if (args.length > 3)
     throw new IllegalArgumentException(
       "Found extra argument(s) startwing with: " + args[3]
     );
    for (int i = 1; args.length > i; i++)
    {
     String[] parts = args[i].split("\\s");
     limits[i - 1] = argsToTimestamp(parts, 0, LIST_COMMAND + " " + ListType.FILES);
    }
   }
   catch (RuntimeException parseErr)
   {
    log().log(
      Level.SEVERE,
      "Error parsing --" + LIST_COMMAND + " " + ListType.FILES
      + " command with arguments: " + Arrays.asList(args),
      parseErr
    );
    setStatus(Status.SYNTAX);
    return;
   }
  log().info("Applying " + query.getEffectiveFilterSpec());
  Cursor<File> list = null;
  try
  {
   list = query.listPaths(limits[0], limits[1], predicate == ListFilesPredicate.CHANGED);
   for (File path; null != (path = list.next());)
   {
    String name = path.getPath();
    if (System.out == out)
     printSplitLine(out, name);
    else
     out.println(name);
   }
  } finally
  {
   if (null != list)
    try
    {
     list.close();
    } catch (Exception ex)
    {
     log().log(Level.FINE, "Could not close " + list, ex);
    }
  }
 }