commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs FileUtil.java
Date Sun, 23 Feb 2003 00:34:24 GMT
adammurdoch    2003/02/22 16:34:24

  Modified:    vfs/src/java/org/apache/commons/vfs FileUtil.java
  Log:
  Added copyContent() utility method.
  
  Revision  Changes    Path
  1.5       +21 -1     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FileUtil.java	21 Feb 2003 05:15:51 -0000	1.4
  +++ FileUtil.java	23 Feb 2003 00:34:24 -0000	1.5
  @@ -127,4 +127,24 @@
           }
       }
   
  +    /**
  +     * Copies the content from a source file to a destination file.
  +     */
  +    public static void copyContent( final FileObject srcFile,
  +                                    final FileObject destFile )
  +        throws IOException
  +    {
  +        // Create the output stream via getContent(), to pick up the
  +        // validation it does
  +        final OutputStream outstr = destFile.getContent().getOutputStream();
  +        try
  +        {
  +            writeContent( srcFile, outstr );
  +        }
  +        finally
  +        {
  +            outstr.close();
  +        }
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message