SimpleShell { public void cat(String[] cmd) throws SimpleShellException { if (cmd.length < 2) { throw new SimpleShellException("USAGE: cat <path>"); } FileObject file; try { file = mgr.resolveFile(cwd, cmd[1]); } catch (FileSystemException ex) { String errMsg = String.format("Error resolving file '%s'", cmd[1]); throw new SimpleShellException(errMsg, ex); } try { if( file.exists() == false ) { System.out.println( String.format("File '%s' does not exist", cmd[1]) ); return; } } catch (FileSystemException ex) { String errMsg = String.format("Error exists() on file '%s'", cmd[1]); throw new SimpleShellException(errMsg, ex); } try { if( file.getType() != FileType.FILE ) { System.out.println( String.format("File '%s' is not an actual file.", cmd[1]) ); return; } } catch (FileSystemException ex) { String errMsg = String.format("Error getType() on file '%s'", cmd[1]); throw new SimpleShellException(errMsg, ex); } try { FileUtil.writeContent(file, System.out); } catch (IOException ex) { String errMsg = String.format("Error WriteContent() on file '%s'", cmd[1]); throw new SimpleShellException(errMsg, ex); } System.out.println(); } 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 testCat001() 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 = "file05"; String currUriStr = String.format("%s: AzConstants.AZSBSCHEME, currAccountStr, currContainerStr, currFileNameStr); String[] cmd = new String[2]; SimpleShell instance = new SimpleShell(currAccountStr, currKey, currContainerStr); cmd[0] = "cat"; cmd[1] = currUriStr; instance.cat(cmd); }