utils
Class FileManager

java.lang.Object
  extended by utils.FileManager

public class FileManager
extends java.lang.Object

Helper class for managing the files

Author:
Mateusz Kopec

Constructor Summary
FileManager()
           
 
Method Summary
static void copyDirectory(java.io.File sourceLocation, java.io.File targetLocation)
          Copies directory recursively.
static java.lang.Object loadObject(java.lang.String path)
          Loads object from file
static void saveObject(java.lang.Object o, java.lang.String path)
          Saves java object at given path
static void saveStringInFile(java.lang.String string, java.lang.String where)
          Saves string to a file
static void saveStringListInFile(java.util.List<java.lang.String> l, java.lang.String where)
          Saves list of strings in a file (in new line each)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManager

public FileManager()
Method Detail

saveObject

public static void saveObject(java.lang.Object o,
                              java.lang.String path)
Saves java object at given path

Parameters:
o - object
path -

loadObject

public static java.lang.Object loadObject(java.lang.String path)
Loads object from file

Parameters:
path - to the file
Returns:
object

saveStringInFile

public static void saveStringInFile(java.lang.String string,
                                    java.lang.String where)
Saves string to a file

Parameters:
string - string to save
where - path to the file

saveStringListInFile

public static void saveStringListInFile(java.util.List<java.lang.String> l,
                                        java.lang.String where)
Saves list of strings in a file (in new line each)

Parameters:
l - list
where - path to the file

copyDirectory

public static void copyDirectory(java.io.File sourceLocation,
                                 java.io.File targetLocation)
                          throws java.io.IOException
Copies directory recursively. If targetLocation does not exist, it will be created.

Parameters:
sourceLocation - from
targetLocation - to
Throws:
java.io.IOException