@Deprecated public abstract class BackupFacility extends Object
BackupFacility.Handle handle; public void commit() { FileObject[] files; . . handle = BackupFacility.getDefault().backup(files); doCommit(); } public void rollback() { //rollback all files handle.restore(); }You can register your own implementation via META-INF services.
Transaction
,
RefactoringElementImplementation.performChange()
,
RefactoringElementImplementation.undoChange()
,
RefactoringElementsBag.registerTransaction(org.netbeans.modules.refactoring.spi.Transaction)
,
RefactoringElementsBag.addFileChange(org.netbeans.modules.refactoring.api.AbstractRefactoring, org.netbeans.modules.refactoring.spi.RefactoringElementImplementation)
,
BackupFacility.Handle
Modifier and Type | Class and Description |
---|---|
static interface |
BackupFacility.Handle
Deprecated.
Handle class representing handle to file(s), which were backuped
by
org.netbeans.modules.refactoring.spi.BackupFacility#backup() |
Modifier and Type | Method and Description |
---|---|
BackupFacility.Handle |
backup(Collection<? extends FileObject> fileObjects)
Deprecated.
does backup
|
abstract BackupFacility.Handle |
backup(FileObject... file)
Deprecated.
does beckup
|
abstract void |
clear()
Deprecated.
do cleanup
all backup files are deleted
all internal structures cleared
default implementa
|
static BackupFacility |
getDefault()
Deprecated.
|
public abstract BackupFacility.Handle backup(FileObject... file) throws IOException
file
- file(s) to backupIOException
- if backup failedpublic final BackupFacility.Handle backup(Collection<? extends FileObject> fileObjects) throws IOException
fileObjects
- FileObjects to backupIOException
public abstract void clear()
public static BackupFacility getDefault()