MOEA Framework 2.12
API Specification

org.moeaframework.util.io
Class FileUtils

java.lang.Object
  extended by org.moeaframework.util.io.FileUtils

public class FileUtils
extends Object

Helper methods for working with files beyond what is provided by File.


Method Summary
static void copy(File source, File destination)
          Copies all the bytes from one file to another.
static void delete(File file)
          Deletes a file.
static void mkdir(File directory)
          Creates the specified directory if it does not yet exist.
static void move(File source, File destination)
          Moves the file from one path to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

move

public static void move(File source,
                        File destination)
                 throws IOException
Moves the file from one path to another. This method can rename a file or move it to a different directory, like the Unix mv command.

Parameters:
source - the source file
destination - the destination file
Throws:
IOException - if an I/O error occurs

copy

public static void copy(File source,
                        File destination)
                 throws IOException
Copies all the bytes from one file to another. .

Parameters:
source - the source file
destination - the destination file
Throws:
IOException - if an I/O error occurred

delete

public static void delete(File file)
                   throws IOException
Deletes a file.

Parameters:
file - the file to delete
Throws:
IOException - if the file could not be deleted

mkdir

public static void mkdir(File directory)
                  throws IOException
Creates the specified directory if it does not yet exist.

Parameters:
directory - the directory to create
Throws:
IOException - if the directory could not be created

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!