public abstract class VCSInterceptor extends Object
Modifier | Constructor and Description |
---|---|
protected |
VCSInterceptor()
Protected constructor, does nothing.
|
Modifier and Type | Method and Description |
---|---|
void |
afterChange(VCSFileProxy file)
Called after a file changed.
|
void |
afterCopy(VCSFileProxy from,
VCSFileProxy to)
Called after a file or folder has been copied.
|
void |
afterCreate(VCSFileProxy file)
Called after a new file or folder has beed created.
|
void |
afterDelete(VCSFileProxy file)
Called after a file or folder is deleted.
|
void |
afterMove(VCSFileProxy from,
VCSFileProxy to)
Called after a file or folder has beed moved.
|
void |
beforeChange(VCSFileProxy file)
Called before a file is changed.
|
boolean |
beforeCopy(VCSFileProxy from,
VCSFileProxy to)
Notifies the interceptor that the file or folder is about to be copied.
|
boolean |
beforeCreate(VCSFileProxy file,
boolean isDirectory)
Notifies the interceptor that the file or folder is about to be created.
|
boolean |
beforeDelete(VCSFileProxy file)
Notifies the interceptor that the file or folder is about to be deleted.
|
void |
beforeEdit(VCSFileProxy file)
Called before a file is about to enter Edit mode.
|
boolean |
beforeMove(VCSFileProxy from,
VCSFileProxy to)
Notifies the interceptor that the file or folder is about to be moved.
|
void |
doCopy(VCSFileProxy from,
VCSFileProxy to)
Called if beforeCopy() returns true and delegates the copy operation to this interceptor.
|
void |
doCreate(VCSFileProxy file,
boolean isDirectory)
Called if beforeCreate() returns true and delegates the create operation to this interceptor.
|
void |
doDelete(VCSFileProxy file)
Called if beforeDelete() returns true and delegates the delete operation to this interceptor.
|
void |
doMove(VCSFileProxy from,
VCSFileProxy to)
Called if beforeMove() returns true and delegates the move operation to this interceptor.
|
Object |
getAttribute(VCSFileProxy file,
String attrName)
Queries the versioning system for a files VCS specific attribute.
|
boolean |
isMutable(VCSFileProxy file)
Queries the versioning system for file mutability (write, delete, move).
|
long |
refreshRecursively(VCSFileProxy dir,
long lastTimeStamp,
List<? super VCSFileProxy> children)
Allows versioning system to exclude some children from recursive
listening check.
|
public boolean isMutable(VCSFileProxy file)
file
- a file to querypublic Object getAttribute(VCSFileProxy file, String attrName)
ProvidedExtensions.RemoteLocation
file
- a file to get the attribute forattrName
- the attributes namepublic boolean beforeDelete(VCSFileProxy file)
file
- a file or an empty folder to be deletedpublic void doDelete(VCSFileProxy file) throws IOException
file
- a file or an empty folder to delete; the interceptor will never be asked to delete a non-empty folderIOException
- if the delete operation failedpublic void afterDelete(VCSFileProxy file)
file
- deleted filepublic boolean beforeMove(VCSFileProxy from, VCSFileProxy to)
from
- the file or folder to be movedto
- destination of the file being movedpublic void doMove(VCSFileProxy from, VCSFileProxy to) throws IOException
from
- the file or folder to be movedto
- destination of the file being movedIOException
- if the move operation failedpublic void afterMove(VCSFileProxy from, VCSFileProxy to)
from
- original location of the fileto
- current location of the filepublic boolean beforeCopy(VCSFileProxy from, VCSFileProxy to)
from
- the file or folder to be copiedto
- destination of the file being copiedpublic void doCopy(VCSFileProxy from, VCSFileProxy to) throws IOException
from
- the file or folder to be copiedto
- destination of the file being copiedIOException
- if the copy operation failedpublic void afterCopy(VCSFileProxy from, VCSFileProxy to)
from
- original location of the fileto
- current location of the filepublic boolean beforeCreate(VCSFileProxy file, boolean isDirectory)
file
- file or folder to be createdpublic void doCreate(VCSFileProxy file, boolean isDirectory) throws IOException
file
- the file to createisDirectory
- true if the new file should be a directory, false otherwiseIOException
- if the create operation failedpublic void afterCreate(VCSFileProxy file)
file
- the new filepublic void afterChange(VCSFileProxy file)
file
- changed filepublic void beforeChange(VCSFileProxy file)
file
- to be changed filepublic void beforeEdit(VCSFileProxy file) throws IOException
file
- file that was just locked and is expected to changeIOEexceptin
- in case it wasn't possible to unlock the file.IOException
public long refreshRecursively(VCSFileProxy dir, long lastTimeStamp, List<? super VCSFileProxy> 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 iterated into this array