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

Quick Search    Search Deep

pspdash
Class FileBackupManager  view FileBackupManager download FileBackupManager.java

java.lang.Object
  extended bypspdash.FileBackupManager

public class FileBackupManager
extends java.lang.Object

Backup data and other files automatically. We want to back up data files (*.dat), defect logs (*.def), the time log (time.log), the state file (state), user settings (pspdash.ini), and the error log (log.txt). Do this each time the dashboard starts. Also do it at midnight.


Field Summary
private static java.lang.String DELIM
           
private static java.lang.String LOG_FILE_NAME
           
private static java.io.OutputStream logFile
           
static int RUNNING
           
static int SHUTDOWN
           
static int STARTUP
           
private static java.lang.String[] WHEN_STR
           
 
Constructor Summary
FileBackupManager()
           
 
Method Summary
private static void backupFiles(java.io.File dataDir, java.io.File backupDir, java.util.Map origFileTimes, java.util.Map origFileSizes, java.util.Map fileTimes, java.util.Map fileSizes, int when)
           
private static boolean inBackupSet(java.io.File f)
           
private static void loadFileInfo(java.io.File list, java.util.Map fileTimes, java.util.Map fileSizes)
           
private static boolean maybeBackupFile(java.io.File f, java.util.zip.ZipOutputStream zip, java.util.Map origFileTimes, java.util.Map origFileSizes, java.util.Map fileTimes, java.util.Map fileSizes)
           
static void maybeRun(java.lang.String dataDirName, int when)
           
private static void printError(java.lang.String msg, java.lang.Throwable t)
           
private static void printError(java.lang.Throwable t)
           
static void run(java.lang.String dataDirName, int when)
           
private static void saveFileInfo(java.io.File list, java.util.Map fileTimes, java.util.Map fileSizes)
           
private static void startLogging(java.io.File dataDir)
           
private static void stopLogging()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STARTUP

public static final int STARTUP
See Also:
Constant Field Values

RUNNING

public static final int RUNNING
See Also:
Constant Field Values

SHUTDOWN

public static final int SHUTDOWN
See Also:
Constant Field Values

logFile

private static java.io.OutputStream logFile

LOG_FILE_NAME

private static final java.lang.String LOG_FILE_NAME
See Also:
Constant Field Values

DELIM

private static final java.lang.String DELIM
See Also:
Constant Field Values

WHEN_STR

private static final java.lang.String[] WHEN_STR
Constructor Detail

FileBackupManager

public FileBackupManager()
Method Detail

maybeRun

public static void maybeRun(java.lang.String dataDirName,
                            int when)

run

public static void run(java.lang.String dataDirName,
                       int when)

loadFileInfo

private static void loadFileInfo(java.io.File list,
                                 java.util.Map fileTimes,
                                 java.util.Map fileSizes)

saveFileInfo

private static void saveFileInfo(java.io.File list,
                                 java.util.Map fileTimes,
                                 java.util.Map fileSizes)

stopLogging

private static void stopLogging()

startLogging

private static void startLogging(java.io.File dataDir)

backupFiles

private static void backupFiles(java.io.File dataDir,
                                java.io.File backupDir,
                                java.util.Map origFileTimes,
                                java.util.Map origFileSizes,
                                java.util.Map fileTimes,
                                java.util.Map fileSizes,
                                int when)

inBackupSet

private static boolean inBackupSet(java.io.File f)

maybeBackupFile

private static boolean maybeBackupFile(java.io.File f,
                                       java.util.zip.ZipOutputStream zip,
                                       java.util.Map origFileTimes,
                                       java.util.Map origFileSizes,
                                       java.util.Map fileTimes,
                                       java.util.Map fileSizes)

printError

private static void printError(java.lang.Throwable t)

printError

private static void printError(java.lang.String msg,
                               java.lang.Throwable t)