List of usage examples for org.apache.commons.vfs FileUtil writeContent
public static void writeContent(final FileObject file, final OutputStream outstr) throws IOException
From source file:org.apache.commons.vfs.example.Shell.java
/** * Does a 'cat' command.// w ww . j a v a 2s.c o m */ private void cat(final String[] cmd) throws Exception { if (cmd.length < 2) { throw new Exception("USAGE: cat <path>"); } // Locate the file final FileObject file = mgr.resolveFile(cwd, cmd[1]); // Dump the contents to System.out FileUtil.writeContent(file, System.out); System.out.println(); }
From source file:org.jclouds.vfs.tools.blobstore.BlobStoreShell.java
/** * Does a 'cat' command./*from w ww . j a v a 2 s . c o m*/ */ private void cat(final String[] cmd) throws Exception { if (cmd.length < 2) { throw new Exception("USAGE: cat <path>"); } // Locate the file final FileObject file = remoteMgr.resolveFile(remoteCwd, cmd[1]); // Dump the contents to System.out FileUtil.writeContent(file, System.out); System.out.println(); }