public class BareBackups
extends java.lang.Object
implements java.io.Serializable
TODO Implement auto backup.
TODO Add boot at OS start.
TODO Add About window (containing author, website, license, etc.).
TODO Add progress bar running on seperate task.
,
Serialized FormModifier and Type | Field and Description |
---|---|
private int |
autoBackupCopies |
private int |
autoBackupID |
private int |
autoBackupInterval |
private java.lang.String |
autoBackupIntervalTime |
private FXMLController |
controller |
private java.lang.String |
inputDirectory |
private java.util.ArrayList<java.lang.String> |
inputFiles |
private java.lang.String |
outputDirectory |
private double |
progressComplete |
private java.lang.String |
saveName |
private static long |
serialVersionUID |
private boolean |
shouldAutoBackup |
private boolean |
shouldForceUnchangedBackups |
Constructor and Description |
---|
BareBackups() |
BareBackups(FXMLController controller)
Initial constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addInputFile(java.lang.String backupFile)
Adds a path+file to the 'backupFile' ArrayList.
|
java.lang.Boolean |
addInputFiles(java.io.File directory)
Adds all files/folders under 'directory' to the 'inputFiles' ArrayList.
|
void |
addLog(java.lang.String message)
Adds a message to the GUI's console and system's console (if running in command line).
|
int |
getAutoBackupID() |
double |
getAutoBackupInterval()
Gets the save interval in seconds.
|
java.lang.String |
getAutoBackupIntervalTime() |
FXMLController |
getController()
Gets the controller to interact with the GUI.
|
java.lang.String |
getInputDirectory()
Gets the input directory to be backed up.
|
java.util.ArrayList<java.lang.String> |
getInputFiles()
Gets a list of files in the input directory.
|
java.lang.String |
getOutputDirectory()
Gets the output directory on where to save the backup file.
|
java.lang.String |
getSaveName()
Gets the save name of the backup.
|
boolean |
getShouldAutoBackup() |
boolean |
isReadyToZip(boolean shouldLog)
Various checks to make sure essential values aren't empty.
|
private void |
readObject(java.io.ObjectInputStream in)
Reloads serialized elements to their according fields.
|
void |
resetInputFiles()
Clears the ArrayList containing which files to backup so unnecessary files aren't backed up.
|
void |
saveBackup()
Adds selected input folder (and its files) to a backup file saved to the selected output directory.
|
void |
setAutoBackupCopies(int backupCopies) |
void |
setAutoBackupID(int ID) |
void |
setAutoBackupInterval(int interval)
Sets the auto save interval.
|
void |
setAutoBackupIntervalTime(java.lang.String autoBackupIntervalTime) |
void |
setController(FXMLController controller)
Sets the controller.
|
void |
setInputDirectory(java.lang.String directory)
Sets the input directory.
|
void |
setInputFiles(java.util.ArrayList<java.lang.String> inputFiles)
Sets the input files.
|
void |
setOutputDirectory(java.lang.String directory)
Sets the output directory.
|
void |
setSaveName(java.lang.String name)
Sets the save name
|
void |
setShouldAutoBackup(boolean shouldAuotBackup) |
void |
setShouldForceUnchangedBackups(boolean shouldForceUnchangedBackups) |
private void |
writeObject(java.io.ObjectOutputStream out)
Serializes select elements so irrelevant ones aren't serialized.
|
private java.util.ArrayList<java.lang.String> inputFiles
private boolean shouldForceUnchangedBackups
private boolean shouldAutoBackup
private double progressComplete
private FXMLController controller
private int autoBackupCopies
private int autoBackupID
private int autoBackupInterval
private static final long serialVersionUID
private java.lang.String autoBackupIntervalTime
private java.lang.String inputDirectory
private java.lang.String outputDirectory
private java.lang.String saveName
public BareBackups()
public BareBackups(FXMLController controller)
controller
- The object used for interacting with the GUI elements.public java.lang.Boolean addInputFiles(java.io.File directory)
directory
- The directory to find files to be added.public void addInputFile(java.lang.String backupFile)
backupFile
- The path+file added to the ArrayList (the file that will be backed up).public void addLog(java.lang.String message)
message
- What will be printed to the console.public boolean isReadyToZip(boolean shouldLog)
shouldLog
- Whether a log should be made if a check doesn't pass.private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- java.io.IOException
java.lang.ClassNotFoundException
public void resetInputFiles()
public void saveBackup()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- java.io.IOException
public int getAutoBackupID()
public double getAutoBackupInterval()
public java.lang.String getAutoBackupIntervalTime()
public FXMLController getController()
public java.lang.String getInputDirectory()
public java.util.ArrayList<java.lang.String> getInputFiles()
public java.lang.String getOutputDirectory()
public java.lang.String getSaveName()
public boolean getShouldAutoBackup()
public void setAutoBackupCopies(int backupCopies)
public void setAutoBackupID(int ID)
public void setAutoBackupInterval(int interval)
interval
- What to set the save interval to.public void setAutoBackupIntervalTime(java.lang.String autoBackupIntervalTime)
public void setController(FXMLController controller)
controller
- What the controller is set to.public void setShouldForceUnchangedBackups(boolean shouldForceUnchangedBackups)
public void setInputDirectory(java.lang.String directory)
directory
- What the input directory is set to.public void setInputFiles(java.util.ArrayList<java.lang.String> inputFiles)
inputFiles
- What to set the input files list to.public void setOutputDirectory(java.lang.String directory)
directory
- What to set the output directory to.public void setSaveName(java.lang.String name)
name
- What to set the save name to.public void setShouldAutoBackup(boolean shouldAuotBackup)