public class RestoreFile extends RandomAccessFile implements Closeable
Modifier and Type | Field and Description |
---|---|
static String |
DEBUG_OPT |
static String |
DUMP_CMD |
static String |
EXTRACT_CMD |
static String |
EXTRACT_DIRECTORY |
static String |
FILTER_PROPERTY |
static String |
HELP_CMD |
static String |
LIST_CMD |
private int |
nbRead |
private int |
nbRecords |
Constructor and Description |
---|
RestoreFile(File file)
Opens a backup file to restore it.
|
Modifier and Type | Method and Description |
---|---|
static void |
dump(File file,
Pattern filter)
Dumps the objects contained in the backup file.
|
static void |
extract(File backupFile,
Pattern filter,
File extractDir)
Extracts the objects contained in the backup file to the specified directory.
|
int |
getNbRecords()
Number of objects recorded in the file.
|
BackupRecord |
getNextRecord()
Reads the next record in file.
|
static void |
list(File file,
Pattern filter)
Lists the objects contained in the backup file.
|
static void |
main(String[] args) |
static void |
usage()
Prints the help message.
|
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
private int nbRecords
private int nbRead
public static final String HELP_CMD
public static final String LIST_CMD
public static final String EXTRACT_CMD
public static final String DUMP_CMD
public static final String EXTRACT_DIRECTORY
public static final String FILTER_PROPERTY
public static final String DEBUG_OPT
public RestoreFile(File file) throws IOException
file
- The file to restore.IOException
- An error occurs.public int getNbRecords()
public BackupRecord getNextRecord() throws IOException
IOException
- An error occurs.public static void list(File file, Pattern filter) throws IOException
file
- The backup file.filter
- The filter.IOException
- An error occurs.public static void extract(File backupFile, Pattern filter, File extractDir) throws IOException
backupFile
- The backup file.filter
- The filter.extractDir
- The directory where to extract the data.IOException
- An error occurs.public static void dump(File file, Pattern filter) throws IOException
file
- The backup file.filter
- The filter.IOException
- An error occurs.public static void main(String[] args)
public static void usage()
Copyright © 2023 ScalAgent D.T.. All rights reserved.