wol.configuration
Class Configuration

java.lang.Object
  extended bywol.configuration.Configuration

public class Configuration
extends Object

This class represents a WakeOnLan configuration.

Author:
Steffen Moldaner

Constructor Summary
Configuration()
           
Configuration(File file)
          Creates a new configuration with the given file.
Configuration(String path)
          Creates a new configuration with the given path.
 
Method Summary
 File getFile()
          Returns the file for this configuration.
 Machine[] getMachines()
          Returns the machines.
 void loadConfig()
          Loads this configuration from the file returned by getFile().
 void saveConfig()
          Saves this configuration to the file returned by getFile().
 void saveConfigAs(File file)
          Saves this configuration to the given file.
 void setMachines(Machine[] machines)
          Sets the machines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()

Configuration

public Configuration(String path)
Creates a new configuration with the given path.

Parameters:
path - a path that denotes a file the configuration will be saved to

Configuration

public Configuration(File file)
Creates a new configuration with the given file. If the file exists the configurations loads immidiatly from this file.

Parameters:
file - a file this configuration will be saved to
See Also:
loadConfig()
Method Detail

getMachines

public Machine[] getMachines()
Returns the machines.

Returns:
the machines

setMachines

public void setMachines(Machine[] machines)
Sets the machines.

Parameters:
machines - the machines

loadConfig

public void loadConfig()
                throws FileNotFoundException
Loads this configuration from the file returned by getFile().

Throws:
FileNotFoundException - if the file does not exist.
See Also:
getFile()

saveConfig

public void saveConfig()
                throws FileNotFoundException
Saves this configuration to the file returned by getFile(). This is equal to saveConfig(getFile()).

Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
See Also:
getFile(), saveConfigAs(File)

saveConfigAs

public void saveConfigAs(File file)
                  throws FileNotFoundException
Saves this configuration to the given file. The configuration will then use this file for saves.

Parameters:
file - the file
Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
See Also:
saveConfigAs(File)

getFile

public File getFile()
Returns the file for this configuration.

Returns:
the file