ch.braincell.stickbackup.config
Class Config

java.lang.Object
  extended by ch.braincell.stickbackup.config.Config

public class Config
extends java.lang.Object

Author:
Andreas Studer

Field Summary
protected static java.lang.String changedColor
           
protected static Config config
           
protected static int defaultChangedColor
           
protected static int defaultDestinationColor
           
protected static int defaultFinishedColor
           
protected static int defaultSourceColor
           
protected static int defaultWorkingColor
           
protected static java.lang.String destinationColor
           
protected static java.lang.String destinationDir
           
protected static java.lang.String destinationDrive
           
protected static java.lang.String destinationSearchDrive
           
protected static java.lang.String finishedColor
           
protected static java.lang.String sourceColor
           
protected static java.lang.String sourceDir
           
protected static java.lang.String sourceDrive
           
protected static java.lang.String sourceSearchDrive
           
protected static java.lang.String workingColor
           
 
Constructor Summary
protected Config()
          Creates a new instance of Config
 
Method Summary
 java.awt.Color getChangedColor()
          Get the color of changed files and directories.
 java.awt.Color getDestinationColor()
          Get the color of destination files and directories to archive.
 java.io.File getDestinationDir()
          Get the destination directory.
 java.awt.Color getFinishedColor()
          Gets the color for finished files and direcories.
static Config getInstance()
          Singleton-pattern: get an instance of Config.
 java.awt.Color getSourceColor()
          Get the color of new source files and directories.
 java.io.File getSourceDir()
          Get the source directory.
 java.awt.Color getWorkingColor()
          Get the color for files and directories on which the process is working on.
 boolean isDestinationDriveSearch()
          Flag to switch destination drive name search on or off.
 boolean isSourceDriveSearch()
          Flag to switch source drive name search on or off.
 boolean isWindows()
          Tests if the system is a Microsoft Windows system.
 void load()
          Load configuration from disk.
 void save()
          Save the configuration to the disk.
 void setChangedColor(java.awt.Color color)
          Set the color of changed files and directories.
 void setDestinationColor(java.awt.Color color)
          Set the color of destination files and directories to archive.
 void setDestinationDir(java.io.File backupDir)
          Sets the destination directory.
 void setDestinationDriveSearch(boolean search)
          Flag to set destination drive name search on or off.
 void setFinishedColor(java.awt.Color color)
          Sets the color for finished files and direcories.
 void setSourceColor(java.awt.Color color)
          Sets the color for new source files.
 void setSourceDir(java.io.File stickDir)
          Sets the source directory.
 void setSourceDriveSearch(boolean search)
          Flag to set source drive name search on or off.
 void setWorkingColor(java.awt.Color color)
          Set the color for files and directories on which the process is working on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceDir

protected static final java.lang.String sourceDir
See Also:
Constant Field Values

sourceDrive

protected static final java.lang.String sourceDrive
See Also:
Constant Field Values

sourceSearchDrive

protected static final java.lang.String sourceSearchDrive
See Also:
Constant Field Values

destinationDir

protected static final java.lang.String destinationDir
See Also:
Constant Field Values

destinationDrive

protected static final java.lang.String destinationDrive
See Also:
Constant Field Values

destinationSearchDrive

protected static final java.lang.String destinationSearchDrive
See Also:
Constant Field Values

sourceColor

protected static final java.lang.String sourceColor
See Also:
Constant Field Values

defaultSourceColor

protected static final int defaultSourceColor
See Also:
Constant Field Values

destinationColor

protected static final java.lang.String destinationColor
See Also:
Constant Field Values

defaultDestinationColor

protected static final int defaultDestinationColor
See Also:
Constant Field Values

changedColor

protected static final java.lang.String changedColor
See Also:
Constant Field Values

defaultChangedColor

protected static final int defaultChangedColor
See Also:
Constant Field Values

workingColor

protected static final java.lang.String workingColor
See Also:
Constant Field Values

defaultWorkingColor

protected static final int defaultWorkingColor
See Also:
Constant Field Values

finishedColor

protected static final java.lang.String finishedColor
See Also:
Constant Field Values

defaultFinishedColor

protected static final int defaultFinishedColor
See Also:
Constant Field Values

config

protected static Config config
Constructor Detail

Config

protected Config()
Creates a new instance of Config

Method Detail

getInstance

public static Config getInstance()
Singleton-pattern: get an instance of Config.

Returns:
the instance of Config.

load

public void load()
          throws java.io.IOException
Load configuration from disk.

Throws:
java.io.IOException

save

public void save()
          throws java.io.IOException
Save the configuration to the disk.

Throws:
java.io.IOException

isWindows

public boolean isWindows()
Tests if the system is a Microsoft Windows system.

Returns:
true if it is windows, false otherwise.

getSourceDir

public java.io.File getSourceDir()
Get the source directory.

Returns:
the source directory.

setSourceDir

public void setSourceDir(java.io.File stickDir)
Sets the source directory.

Parameters:
stickDir - sets the source directory.

isSourceDriveSearch

public boolean isSourceDriveSearch()
Flag to switch source drive name search on or off.

Returns:
true if it should search the drive name sensitive, false if the drive letter should be used.

setSourceDriveSearch

public void setSourceDriveSearch(boolean search)
Flag to set source drive name search on or off.

Parameters:
search - set true if the drive should be searched by name, false otherwise.

getDestinationDir

public java.io.File getDestinationDir()
Get the destination directory.

Returns:
the deatination directory.

setDestinationDir

public void setDestinationDir(java.io.File backupDir)
Sets the destination directory.

Parameters:
stickDir - sets the destination directory.

isDestinationDriveSearch

public boolean isDestinationDriveSearch()
Flag to switch destination drive name search on or off.

Returns:
true if it should search the drive name sensitive, false if the drive letter should be used.

setDestinationDriveSearch

public void setDestinationDriveSearch(boolean search)
Flag to set destination drive name search on or off.

Parameters:
search - set true if the drive should be searched by name, false otherwise.

getSourceColor

public java.awt.Color getSourceColor()
Get the color of new source files and directories.

Returns:
color for new files.

setSourceColor

public void setSourceColor(java.awt.Color color)
Sets the color for new source files.

Parameters:
color - color for new files.

getDestinationColor

public java.awt.Color getDestinationColor()
Get the color of destination files and directories to archive.

Returns:
color for archiving files.

setDestinationColor

public void setDestinationColor(java.awt.Color color)
Set the color of destination files and directories to archive.

Parameters:
color - color for archiving files.

getChangedColor

public java.awt.Color getChangedColor()
Get the color of changed files and directories.

Returns:
color for changed files.

setChangedColor

public void setChangedColor(java.awt.Color color)
Set the color of changed files and directories.

Parameters:
color - color for changed files.

getWorkingColor

public java.awt.Color getWorkingColor()
Get the color for files and directories on which the process is working on.

Returns:
color for "working on" files.

setWorkingColor

public void setWorkingColor(java.awt.Color color)
Set the color for files and directories on which the process is working on.

Parameters:
color - color for "working on" files.

getFinishedColor

public java.awt.Color getFinishedColor()
Gets the color for finished files and direcories.

Returns:
color for finished files.

setFinishedColor

public void setFinishedColor(java.awt.Color color)
Sets the color for finished files and direcories.

Parameters:
color - color for finished files.


Copyright © 2007. All Rights Reserved.