utils
Class FileSaveLoadUtils

Package class diagram package FileSaveLoadUtils
java.lang.Object
  extended by utils.FileSaveLoadUtils

public final class FileSaveLoadUtils
extends Object

Utils which helps with saving loading objects to files - serialization.

Author:
Ondrej Burkert

Constructor Summary
FileSaveLoadUtils()
           
 
Method Summary
static String fileCounterPrefix(String path, int dayCounter, int hourCounter)
          creates a filename in the shape: path0001 for a fileCounter equals to 1
static Object loadObject(String file, Logger log)
          Loading a serialized object from a file on specified path.
static void saveObject(Object obj, String file, Logger log)
          Serialization of an object to a file of specified path
static String setPathFromDialog(String dialogName, String directory)
          Invokes a dialog to get a path to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSaveLoadUtils

public FileSaveLoadUtils()
Method Detail

saveObject

public static void saveObject(Object obj,
                              String file,
                              Logger log)
Serialization of an object to a file of specified path

Parameters:
obj -
file - - path to a file to save to
log -

loadObject

public static Object loadObject(String file,
                                Logger log)
Loading a serialized object from a file on specified path.

Parameters:
file - - path to a file
log -
Returns:

fileCounterPrefix

public static String fileCounterPrefix(String path,
                                       int dayCounter,
                                       int hourCounter)
creates a filename in the shape: path0001 for a fileCounter equals to 1

Parameters:
path -
fileCounter -
Returns:

setPathFromDialog

public static String setPathFromDialog(String dialogName,
                                       String directory)
Invokes a dialog to get a path to a file.

Parameters:
dialogName - - a description in the header of the dialog.
directory - - an initial directory of the dialog (by default Documents and Settings).
Returns:
choosen path or null (Storno)


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.