Package org.tmatesoft.svn.core.wc2
Class SvnSetProperty
- java.lang.Object
-
- org.tmatesoft.svn.core.wc2.SvnOperation<T>
-
- org.tmatesoft.svn.core.wc2.SvnReceivingOperation<SVNPropertyData>
-
- org.tmatesoft.svn.core.wc2.SvnSetProperty
-
- All Implemented Interfaces:
ISvnObjectReceiver<SVNPropertyData>
,ISvnOperationOptionsProvider
public class SvnSetProperty extends SvnReceivingOperation<SVNPropertyData>
Represents set property operation. SetspropertyName
topropertyValue
ontarget
or setspropertyName
topropertyValue
onrevision
in the repository represented by target. ApropertyValue
ofnull
will delete the property. IfpropertyName
is an svn-controlled property (i.e. prefixed with"svn:"
), then the caller is responsible for ensuring that the value is UTF8-encoded and uses LF line-endings.-
If it is the property of the target:
Target
should represent working copy path. Ifdepth
isSVNDepth.EMPTY
, set the property ontarget
only; ifSVNDepth.FILES
, set it ontarget
and its file children (if any); ifSVNDepth.IMMEDIATES
, ontarget
and all of its immediate children (both files and directories); ifSVNDepth.INFINITY
, ontarget
and everything beneath it.changeLists
is a collection ofString
changelist names, used as a restrictive filter on items whose properties are set; that is, don't set properties on any item unless it's a member of one of those changelists. Ifchangelists
is empty (or null), no changelist filtering occurs. *SvnOperation.run()
methods operates only on working copies and does not open any network connection. This method throwsSVNException
if one of the following is true:target
does not exist- exception with
SVNErrorCode.CLIENT_PROPERTY_NAME
error code - if changed property name is a revision property name or not a valid property name or not a regular property name (one starting with a "svn:entry" or "svn:wc" prefix)
-
If it is the property of revision:
Target
can be either URL or working copy path. Iftarget
is working copy path, repository URL is obtained from this.Revision must be set
. Theauthentication manager
, either provided by a caller or a default one, will be used for authentication. Although this routine accepts a working copy path it doesn't affect the working copy at all; it's a pure network operation that changes an *unversioned* property attached to a revision. This can be used to tweak log messages, dates, authors, and the like. Be careful: it's a lossy operation.Also note that unless the administrator creates a pre-revprop-change hook in the repository, this feature will fail.
SvnOperation.run()
returnSVNPropertyData
information of the property This method throwsSVNException
if one of the following is true:- exception with
SVNErrorCode.CLIENT_PROPERTY_NAME
error code - ifpropertyName
is invalid
- exception with
- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SvnSetProperty(SvnOperationFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
ensureArgumentsAreValid()
java.lang.String
getPropertyName()
Returns property name.SVNPropertyValue
getPropertyValue()
Returns property value.ISvnPropertyValueProvider
getPropertyValueProvider()
Returns property value provider callbackboolean
isChangesWorkingCopy()
Gets whether the operation changes working copyboolean
isForce()
Sets whether to skip validity checking.boolean
isRevisionProperty()
Gets whether it is revision property.void
setForce(boolean force)
Sets whether to skip validity checking.void
setPropertyName(java.lang.String propertyName)
Sets property namevoid
setPropertyValue(SVNPropertyValue propertyValue)
Sets property valuevoid
setPropertyValueProvider(ISvnPropertyValueProvider propertyValueProvider)
Sets property value provider callbackvoid
setRevisionProperty(boolean revisionProperty)
Sets whether it is revision property.-
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnReceivingOperation
first, getReceiver, initDefaults, last, receive, run, setReceiver
-
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnOperation
addTarget, cancel, ensureEnoughTargets, ensureHomohenousTargets, getApplicableChangelists, getAuthenticationManager, getCanceller, getDepth, getEventHandler, getFirstTarget, getMaximumTargetsCount, getMinimumTargetsCount, getOperationalWorkingCopy, getOperationFactory, getOptions, getRepositoryPool, getRevision, getSqliteJournalMode, getTargets, hasFileTargets, hasLocalTargets, hasRemoteTargets, isCancelled, isSleepForTimestamp, isUseParentWcFormat, needsHomohenousTargets, run, setApplicalbeChangelists, setDepth, setRevision, setSingleTarget, setSleepForTimestamp, setSqliteJournalMode
-
-
-
-
Constructor Detail
-
SvnSetProperty
protected SvnSetProperty(SvnOperationFactory factory)
-
-
Method Detail
-
isForce
public boolean isForce()
Sets whether to skip validity checking.- Returns:
true
if validity checking should not be done, otherwisefalse
- See Also:
setForce(boolean)
-
setForce
public void setForce(boolean force)
Sets whether to skip validity checking.-
For
target
's property: Ifforce
istrue
, no validity checking is done. But ifforce
isfalse
, andpropertyName
is not a valid property for target,SVNException
is thrown, either with an error codeSVNErrorCode.ILLEGAL_TARGET
(if the property is not appropriate for target), or withSVNErrorCode.BAD_MIME_TYPE
(ifpropertyName
is "svn:mime-type", butpropertyValue
is not a valid mime-type). -
For revision property:
If
force
istrue
new lines in the author property are allowed.
-
For
-
getPropertyValue
public SVNPropertyValue getPropertyValue()
Returns property value.- Returns:
- value of the property
-
setPropertyValue
public void setPropertyValue(SVNPropertyValue propertyValue)
Sets property value- Parameters:
propertyValue
- value of the property
-
setPropertyValueProvider
public void setPropertyValueProvider(ISvnPropertyValueProvider propertyValueProvider)
Sets property value provider callback- Parameters:
propertyValueProvider
- callback that will be called to get property values to set
-
getPropertyValueProvider
public ISvnPropertyValueProvider getPropertyValueProvider()
Returns property value provider callback- Returns:
- property value provider callback set on this operation
-
getPropertyName
public java.lang.String getPropertyName()
Returns property name.- Returns:
- name of the property
-
setPropertyName
public void setPropertyName(java.lang.String propertyName)
Sets property name- Parameters:
propertyName
- name of the property
-
ensureArgumentsAreValid
protected void ensureArgumentsAreValid() throws SVNException
- Overrides:
ensureArgumentsAreValid
in classSvnOperation<SVNPropertyData>
- Throws:
SVNException
-
setRevisionProperty
public void setRevisionProperty(boolean revisionProperty)
Sets whether it is revision property.- Parameters:
revisionProperty
-true
if it is revision property,true
if it istarget
's property
-
isRevisionProperty
public boolean isRevisionProperty()
Gets whether it is revision property.- Returns:
true
if it is revision property,true
if it istarget
's property
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy- Overrides:
isChangesWorkingCopy
in classSvnOperation<SVNPropertyData>
- Returns:
true
if the operation changes the working copy, otherwisefalse
-
-