|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tmatesoft.svn.core.wc.SVNEvent
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) { //get the action type if(event.getAction() == SVNEventAction.UPDATE_UPDATE){ //get the item's node kind SVNNodeKind kind = even.getNodeKind(); //get the item's contents status if(event.getContentsStatus() == SVNStatusType.CHANGED && kind == SVNNodeKind.FILE){ ... } ... //get the item's properties status if(event.getPropertiesStatus() == SVNStatusType.MERGED){ ... } //get the item's lock status if(event.getLockStatus() == SVNStatusType.LOCK_UNLOCKED){ ... } //get the item's relative path String path = event.getPath(); //or in a java.io.File representation File fsEntry = event.getFile(); //get update revision long revision = event.getRevision(); ... } ... } public void checkCancelled() throws SVNCancelException{ throw new SVNCancelException("cancelled!"); } }
import org.tmatesoft.svn.core.wc.SVNUpdateClient; ... SVNUpdateClient updateClient; ... updateClient.setEventHandler(new MyCustomUpdateEventHandler()); ...
updateClient.doUpdate(...);
ISVNEventHandler
,
SVNStatusType
,
SVNEventAction
,
ExamplesConstructor Summary | |
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. |
|
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(SVNErrorMessage errorMessage)
Constructs an SVNEvent object given an error message for a filed operation. |
|
SVNEvent(org.tmatesoft.svn.core.internal.wc.SVNWCAccess source,
org.tmatesoft.svn.core.internal.wc.SVNDirectory dir,
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 filling it with informational details most of that would be retrieved and analized by an ISVNEventHandler implementation. |
|
SVNEvent(org.tmatesoft.svn.core.internal.wc.SVNWCAccess source,
org.tmatesoft.svn.core.internal.wc.SVNDirectory dir,
String name,
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. |
Method Summary | |
SVNEventAction |
getAction()
Gets the type of an action performed upon the item. |
SVNStatusType |
getContentsStatus()
Gets the status type of either file or directory contents. |
SVNErrorMessage |
getErrorMessage()
Gets the error message that (if it's an error situation and therefore the string is not null) points to some fault. |
SVNEventAction |
getExpectedAction()
Returns the expected action. |
File |
getFile()
Gets a java.io.File representation of the item's path. |
SVNLock |
getLock()
Gets the file item's lock information (if any) represented by an SVNLock object. |
SVNStatusType |
getLockStatus()
Gets the file item's lock status. |
String |
getMimeType()
Gets the MIME type of the item relying upon the special SVN's 'svn:mime-type' property. |
SVNNodeKind |
getNodeKind()
Gets the node kind of the item characterizing it as an entry - whether it's a directory, file, etc. |
String |
getPath()
Gets the item's path relative to the Working Copy root directory. |
SVNStatusType |
getPropertiesStatus()
Gets the status type of the item's properties. |
long |
getRevision()
Gets the revision number specific for the action context. |
org.tmatesoft.svn.core.internal.wc.SVNWCAccess |
getSource()
Gets a JavaSVN internal that manages Working Copy entries, administrative area. |
void |
setPath(String path)
Sets the item's path relative to the Working Copy root. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVNEvent(SVNErrorMessage errorMessage)
Used by JavaSVN internals to construct and initialize an SVNEvent object. It's not intended for users (from an API point of view).
errorMessage
- the message describing the operation faultpublic SVNEvent(org.tmatesoft.svn.core.internal.wc.SVNWCAccess source, org.tmatesoft.svn.core.internal.wc.SVNDirectory dir, String name, SVNEventAction action, SVNEventAction expectedAction, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)
Used by JavaSVN 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 expectedAction
.
source
- a JavaSVN internal for managing Working Copy entries,
administrative area, etc.dir
- a JavaSVN internal used to specify the fylesystem root
directory for the entry the event is to be generated forname
- the name of the itemaction
- the type of action the item is exposed toexpectedAction
- the action that is expected to happen, but may
be skipped in real for some reasonkind
- the item's node kindrevision
- a revision numbermimetype
- the item's MIME typecstatus
- the item's contents statuspstatus
- the item's properties statuslstatus
- the item's lock statuslock
- the item's lockerror
- an error messagepublic SVNEvent(org.tmatesoft.svn.core.internal.wc.SVNWCAccess source, org.tmatesoft.svn.core.internal.wc.SVNDirectory dir, String name, SVNEventAction action, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)
Used by JavaSVN internals to construct and initialize an SVNEvent object. It's not intended for users (from an API point of view).
source
- a JavaSVN internal for managing Working Copy entries,
administrative area, etc.dir
- a JavaSVN internal used to specify the fylesystem root
directory for the entry the event is to be generated forname
- the name of the itemaction
- the type of action the item is exposed tokind
- the item's node kindrevision
- a revision numbermimetype
- the item's MIME typecstatus
- the item's contents statuspstatus
- the item's properties statuslstatus
- the item's lock statuslock
- the item's lockerror
- an error messagepublic 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)
Used by JavaSVN 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
.
rootFile
- the item's root directoryfile
- the item's path itselfaction
- the type of action the item is exposed toexpected
- the action that is expected to happen, but may
be skipped in real for some reasonkind
- the item's node kindrevision
- a revision numbermimetype
- the item's MIME typecstatus
- the item's contents statuspstatus
- the item's properties statuslstatus
- the item's lock statuslock
- the item's lockerror
- an error messagepublic SVNEvent(File rootFile, File file, SVNEventAction action, SVNNodeKind kind, long revision, String mimetype, SVNStatusType cstatus, SVNStatusType pstatus, SVNStatusType lstatus, SVNLock lock, SVNErrorMessage error)
Used by JavaSVN internals to construct and initialize an SVNEvent object. It's not intended for users (from an API point of view).
rootFile
- the item's root directoryfile
- the item's path itselfaction
- the type of action the item is exposed tokind
- the item's node kindrevision
- a revision numbermimetype
- the item's MIME typecstatus
- the item's contents statuspstatus
- the item's properties statuslstatus
- the item's lock statuslock
- the item's lockerror
- an error messageMethod Detail |
public org.tmatesoft.svn.core.internal.wc.SVNWCAccess getSource()
public String getPath()
public File getFile()
public SVNEventAction getAction()
public SVNEventAction getExpectedAction()
getAction()
except those cases
when getAction()
returns SVNEventAction.SKIP
(i.e.
when the expected operation is skipped).
public SVNStatusType getContentsStatus()
public SVNErrorMessage getErrorMessage()
public SVNLock getLock()
public SVNStatusType getLockStatus()
public String getMimeType()
You can use 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)){ //your processing }
public SVNNodeKind getNodeKind()
public SVNStatusType getPropertiesStatus()
public long getRevision()
public void setPath(String path)
path
- the item's relative path
|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |