frog.gui
Class FileManagement

java.lang.Object
  extended by frog.gui.FileManagement

public class FileManagement
extends Object

Static FROGUI methods for saving and loading Session files.

Author:
Team Better Recognize

Constructor Summary
FileManagement()
           
 
Method Summary
static File load()
          Displays a JFileChooser for selecting a Session file.
static File save()
          Displays a JFileChooser for selecting a location to save to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManagement

public FileManagement()
Method Detail

load

public static File load()
                 throws IOException
Displays a JFileChooser for selecting a Session file. Checks to make sure the user selects a .frog file and that if the file does not exist, does not try to open it.

Returns:
the location of an existing .frog file.
Throws:
IOException - if the file does not exist

save

public static File save()
                 throws IOException
Displays a JFileChooser for selecting a location to save to. If the user does not specify the .frog suffix, it is added automatically. Also checks to make sure that if the file already exists, the user is prompted to overwrite it or not.

Returns:
the location a Session can be saved to
Throws:
IOException - if the Canonical Path of the location cannot be resolved