Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

MochaBackupClasses
Class MochaOptions  view MochaOptions download MochaOptions.java

java.lang.Object
  extended byMochaBackupClasses.MochaOptions

public final class MochaOptions
extends java.lang.Object

Mocha Backup Options class This class is used for passing options to the Mocha Backup Main Window and to the MochaBackupThread instance.


Field Summary
private static int ABSOLUTEPATHS
           
private static int BACKUP
           
private  java.util.ArrayList backupComponents
          backupComponents - an array of the components to backup
private  short compressionLevel
          compressionLevel - level of zip compression to use.
private  int fBackupFlags
          Backup Operation flag.
private static int INCREMENTAL
           
private  long lastBackupDate
          lastBackupDate - last date the files were backed up.
private  java.io.File lastBackupFile
           
private static int NOGUI
           
private static int RESTORE
           
private  java.lang.String sOutFile
          sOutFile - output filename for the backup.
 
Constructor Summary
MochaOptions()
           
MochaOptions(boolean bIncremental, java.lang.String sOutFile, long lastBackupDate)
          MochaOptions
 
Method Summary
 void addOptions(java.lang.String[] options)
          Adds the command line options to the object.
 java.lang.Object[] getBackupList()
          Gets the array of files and directories to be backed up.
 short getCompressionLevel()
          Gets the compression level for the output zip file.
 long getDate()
          Gets the date of the last backup.
 java.io.File getLastBackupFile()
          Gets the lastBackupFile File object from the object.
 java.lang.String getOutputFile()
          Gets the output filename for the backup file.
 boolean isAbsolutePaths()
          Check to see if we are using absolute paths
 boolean isBackup()
          Check to see if this is a backup operation
 boolean isIncremental()
          Checks to see if this is an incremental backup.
 boolean isRestore()
          Check to see if this is a restore operation
static java.lang.String makeAbsolutePath(java.lang.String path)
          Makes an absolute path from an absolute path.
static java.lang.String makeRelativePath(java.lang.String path)
          Makes a relative path from an absolute or relative path.
 boolean useGUI()
          Check to see if we're using a GUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKUP

private static int BACKUP

RESTORE

private static int RESTORE

INCREMENTAL

private static int INCREMENTAL

NOGUI

private static int NOGUI

ABSOLUTEPATHS

private static int ABSOLUTEPATHS

backupComponents

private java.util.ArrayList backupComponents
backupComponents - an array of the components to backup


compressionLevel

private short compressionLevel
compressionLevel - level of zip compression to use. Must be 0-9


sOutFile

private java.lang.String sOutFile
sOutFile - output filename for the backup. This should be a .zip file name!


lastBackupDate

private long lastBackupDate
lastBackupDate - last date the files were backed up. This is used along with the incremental flag.


lastBackupFile

private java.io.File lastBackupFile

fBackupFlags

private int fBackupFlags
Backup Operation flag. bit 0 represents a backup operation bit 1 represents a restore operation bit 2 represents an incremental backup bit set bit 3 represents not using the GUI bit 4 represents absolute paths

Constructor Detail

MochaOptions

public MochaOptions(boolean bIncremental,
                    java.lang.String sOutFile,
                    long lastBackupDate)
MochaOptions


MochaOptions

public MochaOptions()
Method Detail

isAbsolutePaths

public boolean isAbsolutePaths()
Check to see if we are using absolute paths


isBackup

public boolean isBackup()
Check to see if this is a backup operation


isRestore

public boolean isRestore()
Check to see if this is a restore operation


useGUI

public boolean useGUI()
Check to see if we're using a GUI


getDate

public long getDate()
Gets the date of the last backup.


getLastBackupFile

public java.io.File getLastBackupFile()
Gets the lastBackupFile File object from the object. This can be used to set the last modified date of the file so it can be used in the future when passing it to the --incremental argument. eg. touch the file by calling the File object's setLastModified () method


getCompressionLevel

public short getCompressionLevel()
Gets the compression level for the output zip file.


isIncremental

public boolean isIncremental()
Checks to see if this is an incremental backup.


getOutputFile

public java.lang.String getOutputFile()
Gets the output filename for the backup file.


getBackupList

public java.lang.Object[] getBackupList()
Gets the array of files and directories to be backed up.


addOptions

public void addOptions(java.lang.String[] options)
                throws MochaException
Adds the command line options to the object.


makeRelativePath

public static java.lang.String makeRelativePath(java.lang.String path)
Makes a relative path from an absolute or relative path. This method will remove "../" "./". It will not actually make a relative path out of an absolute path relative to the current directory!


makeAbsolutePath

public static java.lang.String makeAbsolutePath(java.lang.String path)
Makes an absolute path from an absolute path. Generally removes [A-Z]: in a windows system drive letter. Will not make an absolute path out of a relative one!