Package org.tmatesoft.svn.core
Class SVNProperty
java.lang.Object
org.tmatesoft.svn.core.SVNProperty
The SVNProperty class is a representation class for both versioned
properties (user-managed svn specials) and for metaproperties (untweakable)
supported by Subversion. This class holds string constants that are property
names, and gives some useful methods to operate with properties (in particular).
- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn "svn:entry:absent" SVN untweakable metaproperty.static final StringAn "svn:wc:ra_dav:activity-url" SVN untweakable metaproperty.static final SVNPropertyValuestatic final String"cachable-props" SVN untweakable metaproperty.static final StringAn "svn:entry:changelist" SVN untweakable metaproperty.static final StringSVNKitspecific property denoting a charset.static final StringAn "svn:entry:checksum" SVN untweakable metaproperty.static final StringAn "svn:entry:committed-date" SVN untweakable metaproperty.static final StringAn "svn:entry:committed-rev" SVN untweakable metaproperty.static final StringAn "svn:entry:conflict-new" SVN untweakable metaproperty.static final StringAn "svn:entry:conflict-old" SVN untweakable metaproperty.static final StringAn "svn:entry:conflict-wrk" SVN untweakable metaproperty.static final StringAn "svn:entry:copied" SVN untweakable metaproperty.static final StringAn "svn:entry:copyfrom-rev" SVN untweakable metaproperty.static final StringAn "svn:entry:copyfrom-url" SVN untweakable metaproperty.static final StringAn "svn:entry:corrupted" SVN untweakable metaproperty.static final StringAn "svn:entry:deleted" SVN untweakable metaproperty.static final StringAn "svn:entry:depth" SVN untweakable metaproperty.static final byte[]CR (carriage return) EOL (end of line) byte array.static final byte[]CR (carriage return) and LF (line feed) EOL (end of line) bytes array.static final byte[]LF (line feed) EOL (end of line) byte array.static final StringAn "svn:eol-style" SVN special property.static final StringOne of the four possible values of theEOL_STYLEproperty - "CR" (linefeed)static final StringOne of the four possible values of theEOL_STYLEproperty - "CRLF"static final StringOne of the four possible values of theEOL_STYLEproperty - "LF" (line feed)static final StringOne of the four possible values of theEOL_STYLEproperty - "native"static final StringAn "svn:executable" SVN special property.static final StringAn "svn:externals" SVN special property.static final Stringstatic final Stringstatic final Stringstatic final String"has-prop-mods" SVN untweakable metaproperty.static final String"has-props" SVN untweakable metaproperty.static final StringAn "svn:ignore" SVN special property.static final StringAn "svn:entry:incomplete" SVN untweakable metaproperty.static final Stringstatic final Stringstatic final StringAn "svn:entry:keep-local" SVN untweakable metaproperty.static final StringAn "svn:keywords" SVN special property.static final StringAn "svn:entry:kind" SVN untweakable metaproperty.static final StringOne of the two possible values of theKINDproperty - "dir"static final StringOne of the two possible values of theKINDproperty - "file"static final StringAn "svn:entry:last-author" SVN untweakable metaproperty.static final StringAn "svn:entry:lock-comment" SVN untweakable metaproperty.static final StringAn "svn:entry:lock-creation-date" SVN untweakable metaproperty.static final StringAn "svn:entry:lock-owner" SVN untweakable metaproperty.static final StringAn "svn:entry:lock-token" SVN untweakable metaproperty.static final Stringstatic final StringAn "svn:mime-type" SVN special property.static final StringAn "svn:entry:name" SVN untweakable metaproperty.static final StringDefault value for theCHARSETproperty denoting that the native charset should be used to encode a file during translation.static final StringAn "svn:needs-lock" SVN special property.static final String"present-props" SVN untweakable metaproperty.static final StringAn "svn:entry:prop-reject-file" SVN untweakable metaproperty.static final StringAn "svn:entry:prop-time" SVN untweakable metaproperty.static final StringAn "svn:entry:repos" SVN untweakable metaproperty.static final StringAn "svn:entry:revision" SVN untweakable metaproperty.static final StringAn "svn:entry:schedule" SVN untweakable metaproperty.static final StringOne of the three possible values of theSCHEDULEproperty - "add"static final StringOne of the three possible values of theSCHEDULEproperty - "delete"static final StringOne of the three possible values of theSCHEDULEproperty - "replace"static final StringAn "svn:special" SVN special property.static final StringAn "svn:entry:" prefix.static final StringAn "svn:" prefix.static final StringThe namespace for revision properties which are used in repository synching operations.static final StringAn "svn:wc:" prefix.static final StringAn "svnkit:entry:" prefix.static final StringSVNKit's own property namespace.static final StringAn "svnkit:entry:sha1-checksum" SVNKit untweakable metaproperty.static final StringAn "svn:entry:text-time" SVN untweakable metaproperty.static final Stringstatic final StringA special property used in a commit transaction.static final StringA special property used in a commit transaction.static final StringAn "svn:entry:url" SVN untweakable metaproperty.static final StringAn "svn:entry:uuid" SVN untweakable metaproperty.static final StringAn "svn:wc:ra_dav:version-url" SVN untweakable metaproperty.static final StringAn "svn:entry:working-size" SVN untweakable metaproperty.static final longDefault value of theWORKING_SIZEproperty. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddTextMimeType(String textMimeType) Adds custom mime-type value that should be considered as text.static booleanbooleanValue(String text) Converts a string representation of a boolean value to boolean.static voidClears custom mime-types previously added.Returns custom mime-types previously added.static SVNPropertyValuegetValueOfBooleanProperty(String propName) Returns the value for such boolean properties as "svn:executable", "svn:needs-lock" and "svn:special".static booleanisBinaryMimeType(String mimeType) Says if the given MIME-type corresponds to a binary (non-textual) type.static booleanisBooleanProperty(String propName) Checks whether the property is boolean.static booleanisEntryProperty(String name) Says if the given property name starts with theSVN_ENTRY_PREFIXprefix.static booleanisRegularProperty(String name) Checks if a property is regular.static booleanisSVNKitProperty(String name) Says if the given property name starts with theSVNKIT_PREFIX.static booleanisSVNProperty(String name) Says if the given property name starts with theSVN_PREFIXprefix or with theSVNKIT_PREFIX.static booleanisTextMimeType(String mimeType) Says if the given MIME-type corresponds to a text type.static booleanSays if the given charset is the name of UTF-8 encoding.static booleanisWorkingCopyProperty(String name) Says if the given property name starts with theSVN_WC_PREFIXprefix.static longConverts a string representation of a numeric value to a long value.static booleanmimeTypeIsBinary(String mimeType) static StringshortPropertyName(String longName) Returns a short name for the given property name - that is a name without any prefixes.static StringtoString(boolean b) Converts a boolean value to a string representation.static StringtoString(long i) Converts a long value to a string representation.
-
Field Details
-
SVN_PREFIX
An "svn:" prefix.- See Also:
-
SVNKIT_PREFIX
SVNKit's own property namespace.- See Also:
-
SVN_WC_PREFIX
An "svn:wc:" prefix.- See Also:
-
SVN_SYNC_PREFIX
The namespace for revision properties which are used in repository synching operations.- See Also:
-
TXN_CHECK_LOCKS
A special property used in a commit transaction.- See Also:
-
TXN_CHECK_OUT_OF_DATENESS
A special property used in a commit transaction.- See Also:
-
SVN_ENTRY_PREFIX
An "svn:entry:" prefix.- See Also:
-
SVNKIT_ENTRY_PREFIX
An "svnkit:entry:" prefix.- See Also:
-
EOL_STYLE
An "svn:eol-style" SVN special property.- See Also:
-
IGNORE
An "svn:ignore" SVN special property.- See Also:
-
MIME_TYPE
An "svn:mime-type" SVN special property.- See Also:
-
KEYWORDS
An "svn:keywords" SVN special property.- See Also:
-
EXECUTABLE
An "svn:executable" SVN special property.- See Also:
-
EXTERNALS
An "svn:externals" SVN special property.- See Also:
-
SPECIAL
An "svn:special" SVN special property.- See Also:
-
MERGE_INFO
- Since:
- SVN 1.5
- See Also:
-
INHERITABLE_IGNORES
- Since:
- SVN 1.8
- See Also:
-
INHERITABLE_AUTO_PROPS
- Since:
- SVN 1.8
- See Also:
-
REVISION
An "svn:entry:revision" SVN untweakable metaproperty.- See Also:
-
COMMITTED_REVISION
An "svn:entry:committed-rev" SVN untweakable metaproperty.- See Also:
-
COMMITTED_DATE
An "svn:entry:committed-date" SVN untweakable metaproperty.- See Also:
-
HAS_PROPS
"has-props" SVN untweakable metaproperty.- Since:
- 1.1, new in Subversion 1.4
- See Also:
-
HAS_PROP_MODS
"has-prop-mods" SVN untweakable metaproperty.- Since:
- 1.1, new in Subversion 1.4
- See Also:
-
CACHABLE_PROPS
"cachable-props" SVN untweakable metaproperty.- Since:
- 1.1, new in Subversion 1.4
- See Also:
-
PRESENT_PROPS
"present-props" SVN untweakable metaproperty.- Since:
- 1.1, new in Subversion 1.4
- See Also:
-
KEEP_LOCAL
An "svn:entry:keep-local" SVN untweakable metaproperty.- Since:
- 1.2.0, new in Subversion 1.5.0
- See Also:
-
CHANGELIST
An "svn:entry:changelist" SVN untweakable metaproperty.- Since:
- 1.2.0, new in Subversion 1.5.0
- See Also:
-
WORKING_SIZE
An "svn:entry:working-size" SVN untweakable metaproperty.- Since:
- 1.2.0, new in Subversion 1.5.0
- See Also:
-
DEPTH
An "svn:entry:depth" SVN untweakable metaproperty.- Since:
- 1.2.0, new in Subversion 1.5.0
- See Also:
-
FILE_EXTERNAL_PATH
- Since:
- 1.3, new in Subversion 1.6
- See Also:
-
FILE_EXTERNAL_REVISION
- Since:
- 1.3, new in Subversion 1.6
- See Also:
-
FILE_EXTERNAL_PEG_REVISION
- Since:
- 1.3, new in Subversion 1.6
- See Also:
-
TREE_CONFLICT_DATA
- Since:
- 1.3, new in Subversion 1.6
- See Also:
-
CHECKSUM
An "svn:entry:checksum" SVN untweakable metaproperty.- See Also:
-
SVNKIT_SHA1_CHECKSUM
An "svnkit:entry:sha1-checksum" SVNKit untweakable metaproperty.- See Also:
-
URL
An "svn:entry:url" SVN untweakable metaproperty.- See Also:
-
COPYFROM_URL
An "svn:entry:copyfrom-url" SVN untweakable metaproperty.- See Also:
-
COPYFROM_REVISION
An "svn:entry:copyfrom-rev" SVN untweakable metaproperty.- See Also:
-
SCHEDULE
An "svn:entry:schedule" SVN untweakable metaproperty.- See Also:
-
COPIED
An "svn:entry:copied" SVN untweakable metaproperty.- See Also:
-
LAST_AUTHOR
An "svn:entry:last-author" SVN untweakable metaproperty.- See Also:
-
UUID
An "svn:entry:uuid" SVN untweakable metaproperty.- See Also:
-
REPOS
An "svn:entry:repos" SVN untweakable metaproperty.- See Also:
-
PROP_TIME
An "svn:entry:prop-time" SVN untweakable metaproperty.- See Also:
-
TEXT_TIME
An "svn:entry:text-time" SVN untweakable metaproperty.- See Also:
-
NAME
An "svn:entry:name" SVN untweakable metaproperty.- See Also:
-
KIND
An "svn:entry:kind" SVN untweakable metaproperty.- See Also:
-
CONFLICT_OLD
An "svn:entry:conflict-old" SVN untweakable metaproperty.- See Also:
-
CONFLICT_NEW
An "svn:entry:conflict-new" SVN untweakable metaproperty.- See Also:
-
CONFLICT_WRK
An "svn:entry:conflict-wrk" SVN untweakable metaproperty.- See Also:
-
PROP_REJECT_FILE
An "svn:entry:prop-reject-file" SVN untweakable metaproperty.- See Also:
-
DELETED
An "svn:entry:deleted" SVN untweakable metaproperty.- See Also:
-
ABSENT
An "svn:entry:absent" SVN untweakable metaproperty.- See Also:
-
INCOMPLETE
An "svn:entry:incomplete" SVN untweakable metaproperty.- See Also:
-
CORRUPTED
An "svn:entry:corrupted" SVN untweakable metaproperty.- See Also:
-
WC_URL
An "svn:wc:ra_dav:version-url" SVN untweakable metaproperty.- See Also:
-
ACTIVITY_URL
An "svn:wc:ra_dav:activity-url" SVN untweakable metaproperty.- See Also:
-
LOCK_TOKEN
An "svn:entry:lock-token" SVN untweakable metaproperty.- See Also:
-
LOCK_COMMENT
An "svn:entry:lock-comment" SVN untweakable metaproperty.- See Also:
-
LOCK_OWNER
An "svn:entry:lock-owner" SVN untweakable metaproperty.- See Also:
-
LOCK_CREATION_DATE
An "svn:entry:lock-creation-date" SVN untweakable metaproperty.- See Also:
-
NEEDS_LOCK
An "svn:needs-lock" SVN special property.- See Also:
-
KIND_DIR
One of the two possible values of theKINDproperty - "dir"- See Also:
-
KIND_FILE
One of the two possible values of theKINDproperty - "file"- See Also:
-
EOL_STYLE_LF
One of the four possible values of theEOL_STYLEproperty - "LF" (line feed)- See Also:
-
EOL_STYLE_CR
One of the four possible values of theEOL_STYLEproperty - "CR" (linefeed)- See Also:
-
EOL_STYLE_CRLF
One of the four possible values of theEOL_STYLEproperty - "CRLF"- See Also:
-
EOL_STYLE_NATIVE
One of the four possible values of theEOL_STYLEproperty - "native"- See Also:
-
EOL_LF_BYTES
public static final byte[] EOL_LF_BYTESLF (line feed) EOL (end of line) byte array. -
EOL_CRLF_BYTES
public static final byte[] EOL_CRLF_BYTESCR (carriage return) and LF (line feed) EOL (end of line) bytes array. -
EOL_CR_BYTES
public static final byte[] EOL_CR_BYTESCR (carriage return) EOL (end of line) byte array. -
CHARSET
SVNKitspecific property denoting a charset. A user may set this property on files if he would like to fix the charset of the file. Then when checking out, exporting, updating, etc. files with such properties set on them will be translated (encoded) using the charset value of this property. Note that to take advantage of this property a user must utilize a corresponging version of theSVNKitlibrary supporting this property.- See Also:
-
NATIVE
Default value for theCHARSETproperty denoting that the native charset should be used to encode a file during translation. The native charset name will be fetched via a call toISVNOptions.getNativeCharset().- See Also:
-
SCHEDULE_ADD
One of the three possible values of theSCHEDULEproperty - "add"- See Also:
-
SCHEDULE_DELETE
One of the three possible values of theSCHEDULEproperty - "delete"- See Also:
-
SCHEDULE_REPLACE
One of the three possible values of theSCHEDULEproperty - "replace"- See Also:
-
WORKING_SIZE_UNKNOWN
public static final long WORKING_SIZE_UNKNOWNDefault value of theWORKING_SIZEproperty.- Since:
- 1.2.0, new in Subversion 1.5.0
- See Also:
-
BOOLEAN_PROPERTY_VALUE
Default value for such properties asEXECUTABLE,NEEDS_LOCK,SPECIAL. Used only bySVNKitinternals, never stored in a working copy.- Since:
- 1.2.0
-
-
Constructor Details
-
SVNProperty
public SVNProperty()
-
-
Method Details
-
isWorkingCopyProperty
Says if the given property name starts with theSVN_WC_PREFIXprefix.- Parameters:
name- a property name to check- Returns:
- true if
nameis not null and starts with theSVN_WC_PREFIXprefix, otherwise false
-
isEntryProperty
Says if the given property name starts with theSVN_ENTRY_PREFIXprefix.- Parameters:
name- a property name to check- Returns:
- true if
nameis not null and starts with theSVN_ENTRY_PREFIXprefix, otherwise false
-
isSVNProperty
Says if the given property name starts with theSVN_PREFIXprefix or with theSVNKIT_PREFIX.- Parameters:
name- a property name to check- Returns:
- true if
nameis not null and starts with theSVN_PREFIXprefix or with theSVNKIT_PREFIXprefix, otherwise false
-
isSVNKitProperty
Says if the given property name starts with theSVNKIT_PREFIX.- Parameters:
name- a property name to check- Returns:
- true if
nameis not null and starts with theSVNKIT_PREFIXprefix, otherwise false
-
isRegularProperty
Checks if a property is regular. A property is considered to be regular if it is not null and does not start neither withSVN_WC_PREFIXnor withSVN_ENTRY_PREFIX.- Parameters:
name- a property name- Returns:
- true if regular, otherwise false
-
isTextMimeType
Says if the given MIME-type corresponds to a text type.- Parameters:
mimeType- a value of a fileMIME_TYPEproperty- Returns:
- true if
mimeTypeis either null or is a text type (starts with "text/") - See Also:
-
isBinaryMimeType
Says if the given MIME-type corresponds to a binary (non-textual) type.- Parameters:
mimeType- a value of a fileMIME_TYPEproperty- Returns:
- true if
mimeTypeis not a text type - See Also:
-
isUTF8
Says if the given charset is the name of UTF-8 encoding.- Parameters:
charset- a value of a fileCHARSETproperty- Returns:
- true if
charsetis the name of UTF-8 encoding
-
booleanValue
Converts a string representation of a boolean value to boolean. Useful to convert values of theCOPIEDproperty.- Parameters:
text- a string to convert to a boolean value- Returns:
- true if and only if
textis not null and is equal, ignoring case, to the string "true"
-
longValue
Converts a string representation of a numeric value to a long value. Useful to convert revision numbers.- Parameters:
text- a string to convert to a long value- Returns:
- a long representation of the given string; -1 is returned if the string can not be parsed
-
toString
Converts a boolean value to a string representation. Useful to convert values of theCOPIEDproperty.- Parameters:
b- a boolean value- Returns:
- a string representation of
b
-
toString
Converts a long value to a string representation. Useful to convert revision numbers.- Parameters:
i- a long value- Returns:
- a string representation of
i
-
shortPropertyName
Returns a short name for the given property name - that is a name without any prefixes.- Parameters:
longName- a property name- Returns:
- a property short name
-
getValueOfBooleanProperty
Returns the value for such boolean properties as "svn:executable", "svn:needs-lock" and "svn:special". Used by internals.- Parameters:
propName- a property name- Returns:
- the property value "*", or null if the property is not boolean
- Since:
- 1.1
- See Also:
-
isBooleanProperty
Checks whether the property is boolean.- Parameters:
propName- a property name- Returns:
- true if boolean, otherwise false
- Since:
- 1.1
-
addTextMimeType
Adds custom mime-type value that should be considered as text. Otherwise only 'null' mime-types and those starting with 'text/' are considered as text. -
mimeTypeIsBinary
-
getTextMimeTypes
Returns custom mime-types previously added. -
clearTextMimeTypes
public static void clearTextMimeTypes()Clears custom mime-types previously added.
-