public class ProvidedExtensions extends Object implements InterceptionListener
BaseAnnotationProvider.getInterceptionListener()
then
individual instances will be called by MasterFileSystem
There may exist more than one instance of ProvidedExtensions
at a given moment and therefore there is defined for
every method wheter will be called by MasterFileSystem
for every present instance or just for the first one.ProvidedExtensions.IOHandler
,
InterceptionListener
Modifier and Type | Class and Description |
---|---|
static interface |
ProvidedExtensions.DeleteHandler |
static interface |
ProvidedExtensions.IOHandler |
Constructor and Description |
---|
ProvidedExtensions()
Default constructor
|
ProvidedExtensions(boolean providesCanWrite)
Creates a new ProvidedExtensions.
|
Modifier and Type | Method and Description |
---|---|
void |
beforeChange(FileObject fo) |
void |
beforeCopy(FileObject from,
File to)
Called by
MasterFileSystem before FileObject
is copied |
void |
beforeCreate(FileObject parent,
String name,
boolean isFolder) |
void |
beforeDelete(FileObject fo) |
void |
beforeMove(FileObject from,
File to)
Called by
MasterFileSystem before FileObject
is moved |
boolean |
canWrite(File f)
Called by
MasterFileSystem when FileObject is queried for writability with the
canWrite() method. |
void |
copyFailure(FileObject from,
File to)
Called by
MasterFileSystem after a FileObject
copy failed |
void |
copySuccess(FileObject from,
File to)
Called by
MasterFileSystem after FileObject
was successfully copied |
void |
createdExternally(FileObject fo)
Called by
MasterFileSystem after FileObject
was created externally |
void |
createFailure(FileObject parent,
String name,
boolean isFolder) |
void |
createSuccess(FileObject fo) |
void |
deletedExternally(FileObject fo)
Called by
MasterFileSystem after FileObject
was deleted externally |
void |
deleteFailure(FileObject fo) |
void |
deleteSuccess(FileObject fo) |
void |
fileChanged(FileObject fo)
Called by
MasterFileSystem after FileObject
was changed |
void |
fileLocked(FileObject fo) |
void |
fileUnlocked(FileObject fo) |
Object |
getAttribute(File file,
String attrName)
Called by
MasterFileSystem when FileObject is
queried for attribute and attribute's name starts with ProvidedExtensions
prefix. |
ProvidedExtensions.IOHandler |
getCopyHandler(File from,
File to)
Return instance of
ProvidedExtensions.IOHandler
that is responsible for copying the file or null. |
ProvidedExtensions.DeleteHandler |
getDeleteHandler(File f) |
ProvidedExtensions.IOHandler |
getMoveHandler(File from,
File to)
Return instance of
ProvidedExtensions.IOHandler
that is responsible for moving the file or null. |
ProvidedExtensions.IOHandler |
getRenameHandler(File from,
String newName) |
void |
moveFailure(FileObject from,
File to)
Called by
MasterFileSystem after a FileObject
move failed |
void |
moveSuccess(FileObject from,
File to)
Called by
MasterFileSystem after FileObject
was successfully |
static <T> T |
priorityIO(Callable<T> run)
Allows registered exceptions to execute some I/O priority action.
|
long |
refreshRecursively(File dir,
long lastTimeStamp,
List<? super File> children)
Allows versioning system to exclude some children from recursive
listening check.
|
public ProvidedExtensions(boolean providesCanWrite)
providesCanWrite
- true if this instance is meant to
determine a files ProvidedExtensions.canWrite(File)
value, otherwise false.public ProvidedExtensions()
public ProvidedExtensions.IOHandler getCopyHandler(File from, File to)
ProvidedExtensions.IOHandler
that is responsible for copying the file or null.
Just the first non null instance of IOHandler
is used by
MasterFileSystem
from
- file to be copiedto
- target to copy this file toProvidedExtensions.IOHandler
that is responsible for copying the file or nullpublic ProvidedExtensions.IOHandler getMoveHandler(File from, File to)
ProvidedExtensions.IOHandler
that is responsible for moving the file or null.
Just the first non null instance of IOHandler
is used by
MasterFileSystem
from
- file to be movedto
- target to move this file toProvidedExtensions.IOHandler
that is responsible for moving the file or nullpublic ProvidedExtensions.IOHandler getRenameHandler(File from, String newName)
public ProvidedExtensions.DeleteHandler getDeleteHandler(File f)
public void createSuccess(FileObject fo)
createSuccess
in interface InterceptionListener
public void createFailure(FileObject parent, String name, boolean isFolder)
createFailure
in interface InterceptionListener
public void beforeCreate(FileObject parent, String name, boolean isFolder)
beforeCreate
in interface InterceptionListener
public void deleteSuccess(FileObject fo)
deleteSuccess
in interface InterceptionListener
public void deleteFailure(FileObject fo)
deleteFailure
in interface InterceptionListener
public void beforeDelete(FileObject fo)
beforeDelete
in interface InterceptionListener
public void createdExternally(FileObject fo)
MasterFileSystem
after FileObject
was created externallyfo
- created filepublic void deletedExternally(FileObject fo)
MasterFileSystem
after FileObject
was deleted externallyfo
- deleted filepublic void fileChanged(FileObject fo)
MasterFileSystem
after FileObject
was changedfo
- changed filepublic void beforeCopy(FileObject from, File to)
MasterFileSystem
before FileObject
is copiedfrom
- FileObject to be movedto
- File target to move this file topublic void copySuccess(FileObject from, File to)
MasterFileSystem
after FileObject
was successfully copiedfrom
- FileObject to be movedto
- File target to move this file topublic void copyFailure(FileObject from, File to)
MasterFileSystem
after a FileObject
copy failedfrom
- FileObject to be movedto
- File target to move this file topublic void beforeMove(FileObject from, File to)
MasterFileSystem
before FileObject
is movedfrom
- FileObject to be movedto
- File target to move this file topublic void moveSuccess(FileObject from, File to)
MasterFileSystem
after FileObject
was successfullyfrom
- FileObject to be movedto
- File target to move this file topublic void moveFailure(FileObject from, File to)
MasterFileSystem
after a FileObject
move failedfrom
- FileObject to be movedto
- File target to move this file topublic boolean canWrite(File f)
MasterFileSystem
when FileObject
is queried for writability with the
canWrite() method.f
- a file to querypublic void beforeChange(FileObject fo)
public void fileLocked(FileObject fo) throws IOException
IOException
public void fileUnlocked(FileObject fo)
public Object getAttribute(File file, String attrName)
MasterFileSystem
when FileObject
is
queried for attribute and attribute's name starts with ProvidedExtensions
prefix.attrName
- name of attributepublic long refreshRecursively(File dir, long lastTimeStamp, List<? super File> children)
Default implementation of this method returns -1.
dir
- the directory to check timestamp forlastTimeStamp
- the previously known timestamp or -1children
- add subfiles that shall be interated into this array