| java.lang.Object org.tmatesoft.svn.core.wc.SVNEvent
SVNEvent | public class SVNEvent (Code) | | The SVNEvent class is used to provide detailed information on
an operation progress to the ISVNEventHandler (if any) registered
for an SVN*Client object. Such events are generated by
an operation invoked by do*() method of an SVN*Client object
and passed to a developer's event handler for notification. Retrieving
information out of an SVNEvent the developer can decide how it
should be interpreted.
This is an example:
implementing ISVNEventHandler
import org.tmatesoft.svn.core.wc.ISVNEventHandler;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.wc.SVNEvent;
import org.tmatesoft.svn.core.wc.SVNEventAction;
import org.tmatesoft.svn.core.wc.SVNStatusType;
import org.tmatesoft.svn.core.SVNNodeKind;
import java.io.File;
...
public class MyCustomUpdateEventHandler implements ISVNEventHandler {
public void handleEvent(SVNEvent event, double progress) {
if(event.getAction() == SVNEventAction.UPDATE_UPDATE){
SVNNodeKind kind = even.getNodeKind();
if(event.getContentsStatus() == SVNStatusType.CHANGED &&
kind == SVNNodeKind.FILE){
...
}
...
if(event.getPropertiesStatus() == SVNStatusType.MERGED){
...
}
if(event.getLockStatus() == SVNStatusType.LOCK_UNLOCKED){
...
}
String path = event.getPath();
File fsEntry = event.getFile();
long revision = event.getRevision();
...
}
...
}
public void checkCancelled() throws SVNCancelException{
throw new SVNCancelException("cancelled!");
}
}
then registering a handler:
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
...
SVNUpdateClient updateClient;
...
updateClient.setEventHandler(new MyCustomUpdateEventHandler());
...
now when invoking an update operation:
updateClient.doUpdate(...);
the registered instance of the ISVNEventHandler implementation
will be dispatched progress events.
version: 1.1.1 author: TMate Software Ltd. See Also: ISVNEventHandler See Also: SVNStatusType See Also: SVNEventAction See Also: Examples |
Constructor Summary | |
public | SVNEvent(SVNErrorMessage errorMessage) Constructs an SVNEvent object given
an error message for a filed operation. | public | SVNEvent(SVNAdminAreaInfo info, SVNAdminArea adminArea, String name, SVNEventAction action, SVNEventAction expectedAction, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error) Constructs an SVNEvent object.
Used by SVNKit internals to construct and initialize an
SVNEvent object. | public | SVNEvent(SVNAdminAreaInfo info, SVNAdminArea adminArea, String name, SVNEventAction action, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error) Constructs an SVNEvent object.
Used by SVNKit internals to construct and initialize an
SVNEvent object. | public | SVNEvent(File rootFile, File file, SVNEventAction action, SVNEventAction expected, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error) Constructs an SVNEvent object filling it with informational
details most of that would be retrieved and analized by an
ISVNEventHandler implementation. | public | SVNEvent(File rootFile, File file, SVNEventAction action, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error) Constructs an SVNEvent object filling it with informational
details most of that would be retrieved and analized by an
ISVNEventHandler implementation. |
SVNEvent | public SVNEvent(SVNErrorMessage errorMessage)(Code) | | Constructs an SVNEvent object given
an error message for a filed operation.
Used by SVNKit internals to construct and initialize an
SVNEvent object. It's not intended for users (from an API point of view).
Parameters: errorMessage - the message describing the operation fault |
SVNEvent | public SVNEvent(SVNAdminAreaInfo info, SVNAdminArea adminArea, String name, SVNEventAction action, SVNEventAction expectedAction, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)(Code) | | Constructs an SVNEvent object.
Used by SVNKit internals to construct and initialize an
SVNEvent object. It's not intended for users (from an API point of view).
Parameters: info - admin info Parameters: adminArea - admin area the item belongs to Parameters: name - the item's name Parameters: action - the type of action the item is exposed to Parameters: expectedAction - the action type that was expected Parameters: kind - the item's node kind Parameters: revision - a revision number Parameters: mimetype - the item's MIME type Parameters: cstatus - the item's contents status Parameters: pstatus - the item's properties status Parameters: lstatus - the item's lock status Parameters: lock - the item's lock Parameters: error - an error message |
SVNEvent | public SVNEvent(SVNAdminAreaInfo info, SVNAdminArea adminArea, String name, SVNEventAction action, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)(Code) | | Constructs an SVNEvent object.
Used by SVNKit internals to construct and initialize an
SVNEvent object. It's not intended for users (from an API point of view).
Parameters: info - admin info Parameters: adminArea - admin area the item belongs to Parameters: name - the item's name Parameters: action - the type of action the item is exposed to Parameters: kind - the item's node kind Parameters: revision - a revision number Parameters: mimetype - the item's MIME type Parameters: cstatus - the item's contents status Parameters: pstatus - the item's properties status Parameters: lstatus - the item's lock status Parameters: lock - the item's lock Parameters: error - an error message |
SVNEvent | public SVNEvent(File rootFile, File file, SVNEventAction action, SVNEventAction expected, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)(Code) | | Constructs an SVNEvent object filling it with informational
details most of that would be retrieved and analized by an
ISVNEventHandler implementation.
Used by SVNKit internals to construct and initialize an
SVNEvent object. It's not intended for users (from an API point of view).
If action is
SVNEventAction.SKIP (i.e. operation is skipped)
then the expected action (that would have occurred if the operation hadn't been skipped)
is provided in expected .
Parameters: rootFile - the item's root directory Parameters: file - the item's path itself Parameters: action - the type of action the item is exposed to Parameters: expected - the action that is expected to happen, but maybe skipped in real for some reason Parameters: kind - the item's node kind Parameters: revision - a revision number Parameters: mimetype - the item's MIME type Parameters: cstatus - the item's contents status Parameters: pstatus - the item's properties status Parameters: lstatus - the item's lock status Parameters: lock - the item's lock Parameters: error - an error message |
SVNEvent | public SVNEvent(File rootFile, File file, SVNEventAction action, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)(Code) | | Constructs an SVNEvent object filling it with informational
details most of that would be retrieved and analized by an
ISVNEventHandler implementation.
Used by SVNKit internals to construct and initialize an
SVNEvent object. It's not intended for users (from an API point of view).
Parameters: rootFile - the item's root directory Parameters: file - the item's path itself Parameters: action - the type of action the item is exposed to Parameters: kind - the item's node kind Parameters: revision - a revision number Parameters: mimetype - the item's MIME type Parameters: cstatus - the item's contents status Parameters: pstatus - the item's properties status Parameters: lstatus - the item's lock status Parameters: lock - the item's lock Parameters: error - an error message |
getAction | public SVNEventAction getAction()(Code) | | Gets the type of an action performed upon the item. An action is
one of predefined SVNEventAction constants that are specific for
each kind of operation, such as update actions, commit actions, etc.
the current action |
getContentsStatus | public SVNStatusType getContentsStatus()(Code) | | Gets the status type of either file or directory contents.
Use predefined SVNStatusType constants to examine the
item's status. For a directory contents are its entries.
the item's status type |
getErrorMessage | public SVNErrorMessage getErrorMessage()(Code) | | Gets the error message that (if it's an error situation and
therefore the string is not null)
points to some fault.
an error message (in case of an error occured) or null if everythingis OK |
getFile | public File getFile()(Code) | | Gets a java.io.File representation of the item's path.
the item's path |
getLock | public SVNLock getLock()(Code) | | Gets the file item's lock information (if any) represented by an
SVNLock object.
the file item's lock info if the file is locked; otherwise null |
getLockStatus | public SVNStatusType getLockStatus()(Code) | | Gets the file item's lock status. The value of
SVNStatusType.LOCK_INAPPLICABLE means
the lock status is irrelevant during the current event action.
the lock status of the file item |
getMimeType | public String getMimeType()(Code) | | Gets the MIME type of the item relying upon the special
SVN's 'svn:mime-type' property.
You can use
org.tmatesoft.svn.core.SVNProperty 's metods to
find out whether it's a text MIME type or a binary:
import org.tmatesoft.svn.core.SVNProperty;
...
String mimeType = event.getMimeType();
if(SVNProperty.isBinaryMimeType(mimeType)){
}
the item's MIME type as a string or null if the item has no'svn:mime-type' property set |
getNodeKind | public SVNNodeKind getNodeKind()(Code) | | Gets the node kind of the item characterizing it as an entry -
whether it's a directory, file, etc. The value of
SVNNodeKind.NONE may mean the node kind is
inapplicable diring the current event action. The value of
SVNNodeKind.UNKNOWN may mean deleted entries.
the item's node kind |
getPath | public String getPath()(Code) | | Gets the item's path relative to the Working Copy root directory.
a string representation of the item's path |
getPropertiesStatus | public SVNStatusType getPropertiesStatus()(Code) | | Gets the status type of the item's properties.
The value of SVNStatusType.INAPPLICABLE may mean
the item has no versioned properties or that properties status is
irrelevant during the current event action.
the status type of the item's properties |
getRevision | public long getRevision()(Code) | | Gets the revision number specific for the action context.
It may be whether an update revision or a committed one or
an inapplicable value when a revision number is irrelevant during
the event action.
a revision number |
setPath | public void setPath(String path)(Code) | | Sets the item's path relative to the Working Copy root.
Parameters: path - the item's relative path |
|
|