else
{
recursive = false;
}
final FileObject file;
if (cmd.length > pos)
{
file = mgr.resolveFile(cwd, cmd[pos]);
}
else
{
file = cwd;
}
if (file.getType() == FileType.FOLDER)
{
// List the contents
System.out.println("Contents of " + file.getName());
listChildren(file, recursive, "");
}
else
{
// Stat the file
System.out.println(file.getName());
final FileContent content = file.getContent();
System.out.println("Size: " + content.getSize() + " bytes.");
final DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
final String lastMod = dateFormat.format(new Date(content.getLastModifiedTime()));
System.out.println("Last modified: " + lastMod);
}