SimpleShell { public void ls(final String[] cmd) throws FileSystemException { int pos = 1; final boolean recursive; if (cmd.length > pos && cmd[pos].equals("-R")) { recursive = true; pos++; } else { recursive = false; } final FileObject file; if (cmd.length > pos) { file = mgr.resolveFile(cwd, cmd[pos]); } else { file = cwd; } switch(file.getType()) { case FOLDER: System.out.println("Contents of " + file.getName()); listChildren(file, recursive, ""); break; case 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); break; case IMAGINARY: System.out.println(String.format("File '%s' is IMAGINARY", file.getName())); break; default: log.error(String.format("Unkown type '%d' on '%s'", file.getType(), file.getName())); break; } } SimpleShell();  SimpleShell(String accnt, String key, String cont); static void main(final String[] args); void go(); void help(); void rm(final String[] cmd); void cp(String[] cmd); void cat(String[] cmd); void pwd(); void cd(final String[] cmd); void ls(final String[] cmd); void touch(final String[] cmd); void listChildren(final FileObject dir,
                              final boolean recursive,
                              final String prefix);  }
@Test public void testLs001() throws Exception { String currAccountStr = testProperties.getProperty("azure.account.name"); String currKey = testProperties.getProperty("azure.account.key"); String currContainerStr = testProperties.getProperty("azure.test0001.container.name"); String currFileNameStr = ""; String currUriStr = String.format("%s: AzConstants.AZSBSCHEME, currAccountStr, currContainerStr, currFileNameStr); String[] cmd = new String[2]; SimpleShell instance = new SimpleShell(currAccountStr, currKey, currContainerStr); cmd[0] = "ls"; cmd[1] = currUriStr; instance.ls(cmd); }