public class Defragment
extends java.lang.Object
Defragment.defrag("sample.db4o");DefragmentConfig config=new DefragmentConfig("sample.db4o","sample.bap",new BTreeIDMapping("sample.map"));
config.forceBackupDelete(true);
config.storedClassFilter(new AvailableClassFilter());
config.db4oConfig(db4oConfig);
Defragment.defrag(config);Configuration passed as db4oConfig.
Note: For some specific, non-default configuration settings like
UUID generation, etc., you must pass an appropriate db4o configuration,
just like you'd use it within your application for normal database operation.| Constructor and Description |
|---|
Defragment() |
| Modifier and Type | Method and Description |
|---|---|
static void |
defrag(DefragmentConfig config)
Renames the file at the configured original path to the configured backup
path and then builds a defragmented version of the file in the original
place.
|
static void |
defrag(DefragmentConfig config,
DefragmentListener listener)
Renames the file at the configured original path to the configured backup
path and then builds a defragmented version of the file in the original
place.
|
static void |
defrag(java.lang.String origPath)
Renames the file at the given original path to a backup file and then
builds a defragmented version of the file in the original place.
|
static void |
defrag(java.lang.String origPath,
java.lang.String backupPath)
Renames the file at the given original path to the given backup file and
then builds a defragmented version of the file in the original place.
|
public static void defrag(java.lang.String origPath)
throws java.io.IOException
origPath - The path to the file to be defragmented.java.io.IOException - if the original file cannot be moved to the backup locationpublic static void defrag(java.lang.String origPath,
java.lang.String backupPath)
throws java.io.IOException
origPath - The path to the file to be defragmented.backupPath - The path to the backup file to be created.java.io.IOException - if the original file cannot be moved to the backup locationpublic static void defrag(DefragmentConfig config) throws java.io.IOException
config - The configuration for this defragmentation run.java.io.IOException - if the original file cannot be moved to the backup locationpublic static void defrag(DefragmentConfig config, DefragmentListener listener) throws java.io.IOException
config - The configuration for this defragmentation run.listener - A listener for status notifications during the defragmentation
process.java.io.IOException - if the original file cannot be moved to the backup location