commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons-sandbox/io/src/java/org/apache/commons/io FileUtils.java
Date Sat, 22 Jun 2002 06:52:40 GMT
dion        2002/06/21 23:52:40

  Modified:    io/src/java/org/apache/commons/io FileUtils.java
  Log:
  Added fileCopy method
  
  Revision  Changes    Path
  1.7       +17 -1     jakarta-commons-sandbox/io/src/java/org/apache/commons/io/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/FileUtils.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileUtils.java	12 Jun 2002 19:50:40 -0000	1.6
  +++ FileUtils.java	22 Jun 2002 06:52:40 -0000	1.7
  @@ -221,6 +221,22 @@
           out.write(data.getBytes());
           out.close();
       }
  +    
  +    /**
  +     * Copy a file. The new file will be created if it does not exist. This is
  +     * an inefficient method, which just calls {@link #fileRead(String)} and
  +     * then {@link #fileWrite(String,String)}
  +     *
  +     * @param inFileName the file to copy
  +     * @param outFileName the file to copy to
  +     * @throws Exception if fileRead or fileWrite throw it
  +     */
  +    public static void fileCopy(String inFileName, String outFileName) throws
  +        Exception
  +    {
  +        String content = FileUtils.fileRead(inFileName);
  +        FileUtils.fileWrite(outFileName, content);
  +    }
   
       /**
        * Deletes a file.
  
  
  

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


Mime
View raw message