SimpleShell { public void cp(String[] cmd) throws SimpleShellException { if (cmd.length < 3) { throw new SimpleShellException("USAGE: cp <src> <dest>"); } FileObject src = null; try { src = mgr.resolveFile(cwd, cmd[1]); } catch (FileSystemException ex) { String errMsg = String.format("Error resolving source file '%s'", cmd[1]); throw new SimpleShellException(errMsg, ex); } FileObject dest = null; try { dest = mgr.resolveFile(cwd, cmd[2]); } catch (FileSystemException ex) { String errMsg = String.format("Error resolving destination file '%s'", cmd[2]); throw new SimpleShellException(errMsg, ex); } try { if (dest.exists() && dest.getType() == FileType.FOLDER) { dest = dest.resolveFile(src.getName().getBaseName()); } } catch (FileSystemException ex) { String errMsg = String.format("Error resolving folder '%s'", cmd[2]); throw new SimpleShellException(errMsg, ex); } try { dest.copyFrom(src, Selectors.SELECT_ALL); } catch (FileSystemException ex) { String errMsg = String.format("Error copyFrom() file '%s' to '%s'", cmd[1], cmd[2]); throw new SimpleShellException(errMsg, ex); } } 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 testCp001() 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 currSrcUriStr = String.format("%s: AzConstants.AZSBSCHEME, currAccountStr, currContainerStr, currFileNameStr); currFileNameStr = "testFld/file06"; String currDestUriStr = String.format("%s: AzConstants.AZSBSCHEME, currAccountStr, currContainerStr, currFileNameStr); String[] cmd = new String[3]; SimpleShell instance = new SimpleShell(currAccountStr, currKey, currContainerStr); cmd[0] = "cp"; cmd[1] = currSrcUriStr; cmd[2] = currDestUriStr; instance.cp(cmd); }