org.tmatesoft.svn.core

Class SVNProperty

public class SVNProperty extends Object

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).

Version: 1.1.1

Author: TMate Software Ltd.

Field Summary
static StringABSENT
An "svn:entry:absent" SVN untweakable metaproperty.
static StringCACHABLE_PROPS
"cachable-props" SVN untweakable metaproperty.
static StringCHECKSUM
An "svn:entry:checksum" SVN untweakable metaproperty.
static StringCOMMITTED_DATE
An "svn:entry:committed-date" SVN untweakable metaproperty.
static StringCOMMITTED_REVISION
An "svn:entry:committed-rev" SVN untweakable metaproperty.
static StringCONFLICT_NEW
An "svn:entry:conflict-new" SVN untweakable metaproperty.
static StringCONFLICT_OLD
An "svn:entry:conflict-old" SVN untweakable metaproperty.
static StringCONFLICT_WRK
An "svn:entry:conflict-wrk" SVN untweakable metaproperty.
static StringCOPIED
An "svn:entry:copied" SVN untweakable metaproperty.
static StringCOPYFROM_REVISION
An "svn:entry:copyfrom-rev" SVN untweakable metaproperty.
static StringCOPYFROM_URL
An "svn:entry:copyfrom-url" SVN untweakable metaproperty.
static StringCORRUPTED
An "svn:entry:corrupted" SVN untweakable metaproperty.
static StringDELETED
An "svn:entry:deleted" SVN untweakable metaproperty.
static StringEOL_STYLE
An "svn:eol-style" SVN special property.
static StringEOL_STYLE_CR
One of the four possible values of the EOL_STYLE property - "CR" (linefeed)
static StringEOL_STYLE_CRLF
One of the four possible values of the EOL_STYLE property - "CRLF"
static StringEOL_STYLE_LF
One of the four possible values of the EOL_STYLE property - "LF" (line feed)
static StringEOL_STYLE_NATIVE
One of the four possible values of the EOL_STYLE property - "native"
static StringEXECUTABLE
An "svn:executable" SVN special property.
static StringEXTERNALS
An "svn:externals" SVN special property.
static StringHAS_PROPS
"has-props" SVN untweakable metaproperty.
static StringHAS_PROP_MODS
"has-prop-mods" SVN untweakable metaproperty.
static StringIGNORE
An "svn:ignore" SVN special property.
static StringINCOMPLETE
An "svn:entry:incomplete" SVN untweakable metaproperty.
static StringKEYWORDS
An "svn:keywords" SVN special property.
static StringKIND
An "svn:entry:kind" SVN untweakable metaproperty.
static StringKIND_DIR
One of the two possible values of the KIND property - "dir"
static StringKIND_FILE
One of the two possible values of the KIND property - "file"
static StringLAST_AUTHOR
An "svn:entry:last-author" SVN untweakable metaproperty.
static StringLOCK_COMMENT
An "svn:entry:lock-comment" SVN untweakable metaproperty.
static StringLOCK_CREATION_DATE
An "svn:entry:lock-creation-date" SVN untweakable metaproperty.
static StringLOCK_OWNER
An "svn:entry:lock-owner" SVN untweakable metaproperty.
static StringLOCK_TOKEN
An "svn:entry:lock-token" SVN untweakable metaproperty.
static StringMIME_TYPE
An "svn:mime-type" SVN special property.
static StringNAME
An "svn:entry:name" SVN untweakable metaproperty.
static StringNEEDS_LOCK
An "svn:needs-lock" SVN special property.
static StringPRESENT_PROPS
"present-props" SVN untweakable metaproperty.
static StringPROP_REJECT_FILE
An "svn:entry:prop-reject-file" SVN untweakable metaproperty.
static StringPROP_TIME
An "svn:entry:prop-time" SVN untweakable metaproperty.
static StringREPOS
An "svn:entry:repos" SVN untweakable metaproperty.
static StringREVISION
An "svn:entry:revision" SVN untweakable metaproperty.
static StringSCHEDULE
An "svn:entry:schedule" SVN untweakable metaproperty.
static StringSCHEDULE_ADD
One of the three possible values of the SCHEDULE property - "add"
static StringSCHEDULE_DELETE
One of the three possible values of the SCHEDULE property - "delete"
static StringSCHEDULE_REPLACE
One of the three possible values of the SCHEDULE property - "replace"
static StringSPECIAL
An "svn:special" SVN special property.
static StringSVN_ENTRY_PREFIX
An "svn:entry:" prefix.
static StringSVN_PREFIX
An "svn:" prefix.
static StringSVN_WC_PREFIX
An "svn:wc:" prefix.
static StringTEXT_TIME
An "svn:entry:text-time" SVN untweakable metaproperty.
static StringTXN_CHECK_LOCKS
A special property used in a commit transaction.
static StringTXN_CHECK_OUT_OF_DATENESS
A special property used in a commit transaction.
static StringURL
An "svn:entry:url" SVN untweakable metaproperty.
static StringUUID
An "svn:entry:uuid" SVN untweakable metaproperty.
static StringWC_URL
An "svn:wc:ra_dav:version-url" SVN untweakable metaproperty.
Method Summary
static booleanbooleanValue(String text)
Converts a string representation of a boolean value to boolean.
static byte[]getEOLBytes(String eolType)
Returns eol-marker bytes according to the given eol type.
static StringgetValueOfBooleanProperty(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 the SVN_ENTRY_PREFIX prefix.
static booleanisRegularProperty(String name)
Checks if a property is regular.
static booleanisSVNProperty(String name)
Says if the given property name starts with the SVN_PREFIX prefix.
static booleanisTextMimeType(String mimeType)
Says if the given MIME-type corresponds to a text type.
static booleanisWorkingCopyProperty(String name)
Says if the given property name starts with the SVN_WC_PREFIX prefix.
static longlongValue(String text)
Converts a string representation of a numeric value to a long value.
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 Detail

ABSENT

public static final String ABSENT
An "svn:entry:absent" SVN untweakable metaproperty.

CACHABLE_PROPS

public static final String CACHABLE_PROPS
"cachable-props" SVN untweakable metaproperty.

Since: 1.1, new in Subversion 1.4

CHECKSUM

public static final String CHECKSUM
An "svn:entry:checksum" SVN untweakable metaproperty.

COMMITTED_DATE

public static final String COMMITTED_DATE
An "svn:entry:committed-date" SVN untweakable metaproperty.

COMMITTED_REVISION

public static final String COMMITTED_REVISION
An "svn:entry:committed-rev" SVN untweakable metaproperty.

CONFLICT_NEW

public static final String CONFLICT_NEW
An "svn:entry:conflict-new" SVN untweakable metaproperty.

CONFLICT_OLD

public static final String CONFLICT_OLD
An "svn:entry:conflict-old" SVN untweakable metaproperty.

CONFLICT_WRK

public static final String CONFLICT_WRK
An "svn:entry:conflict-wrk" SVN untweakable metaproperty.

COPIED

public static final String COPIED
An "svn:entry:copied" SVN untweakable metaproperty.

COPYFROM_REVISION

public static final String COPYFROM_REVISION
An "svn:entry:copyfrom-rev" SVN untweakable metaproperty.

COPYFROM_URL

public static final String COPYFROM_URL
An "svn:entry:copyfrom-url" SVN untweakable metaproperty.

CORRUPTED

public static final String CORRUPTED
An "svn:entry:corrupted" SVN untweakable metaproperty.

DELETED

public static final String DELETED
An "svn:entry:deleted" SVN untweakable metaproperty.

EOL_STYLE

public static final String EOL_STYLE
An "svn:eol-style" SVN special property.

EOL_STYLE_CR

public static final String EOL_STYLE_CR
One of the four possible values of the EOL_STYLE property - "CR" (linefeed)

EOL_STYLE_CRLF

public static final String EOL_STYLE_CRLF
One of the four possible values of the EOL_STYLE property - "CRLF"

EOL_STYLE_LF

public static final String EOL_STYLE_LF
One of the four possible values of the EOL_STYLE property - "LF" (line feed)

EOL_STYLE_NATIVE

public static final String EOL_STYLE_NATIVE
One of the four possible values of the EOL_STYLE property - "native"

EXECUTABLE

public static final String EXECUTABLE
An "svn:executable" SVN special property.

EXTERNALS

public static final String EXTERNALS
An "svn:externals" SVN special property.

HAS_PROPS

public static final String HAS_PROPS
"has-props" SVN untweakable metaproperty.

Since: 1.1, new in Subversion 1.4

HAS_PROP_MODS

public static final String HAS_PROP_MODS
"has-prop-mods" SVN untweakable metaproperty.

Since: 1.1, new in Subversion 1.4

IGNORE

public static final String IGNORE
An "svn:ignore" SVN special property.

INCOMPLETE

public static final String INCOMPLETE
An "svn:entry:incomplete" SVN untweakable metaproperty.

KEYWORDS

public static final String KEYWORDS
An "svn:keywords" SVN special property.

KIND

public static final String KIND
An "svn:entry:kind" SVN untweakable metaproperty.

KIND_DIR

public static final String KIND_DIR
One of the two possible values of the KIND property - "dir"

KIND_FILE

public static final String KIND_FILE
One of the two possible values of the KIND property - "file"

LAST_AUTHOR

public static final String LAST_AUTHOR
An "svn:entry:last-author" SVN untweakable metaproperty.

LOCK_COMMENT

public static final String LOCK_COMMENT
An "svn:entry:lock-comment" SVN untweakable metaproperty.

LOCK_CREATION_DATE

public static final String LOCK_CREATION_DATE
An "svn:entry:lock-creation-date" SVN untweakable metaproperty.

LOCK_OWNER

public static final String LOCK_OWNER
An "svn:entry:lock-owner" SVN untweakable metaproperty.

LOCK_TOKEN

public static final String LOCK_TOKEN
An "svn:entry:lock-token" SVN untweakable metaproperty.

MIME_TYPE

public static final String MIME_TYPE
An "svn:mime-type" SVN special property.

NAME

public static final String NAME
An "svn:entry:name" SVN untweakable metaproperty.

NEEDS_LOCK

public static final String NEEDS_LOCK
An "svn:needs-lock" SVN special property.

PRESENT_PROPS

public static final String PRESENT_PROPS
"present-props" SVN untweakable metaproperty.

Since: 1.1, new in Subversion 1.4

PROP_REJECT_FILE

public static final String PROP_REJECT_FILE
An "svn:entry:prop-reject-file" SVN untweakable metaproperty.

PROP_TIME

public static final String PROP_TIME
An "svn:entry:prop-time" SVN untweakable metaproperty.

REPOS

public static final String REPOS
An "svn:entry:repos" SVN untweakable metaproperty.

REVISION

public static final String REVISION
An "svn:entry:revision" SVN untweakable metaproperty.

SCHEDULE

public static final String SCHEDULE
An "svn:entry:schedule" SVN untweakable metaproperty.

SCHEDULE_ADD

public static final String SCHEDULE_ADD
One of the three possible values of the SCHEDULE property - "add"

SCHEDULE_DELETE

public static final String SCHEDULE_DELETE
One of the three possible values of the SCHEDULE property - "delete"

SCHEDULE_REPLACE

public static final String SCHEDULE_REPLACE
One of the three possible values of the SCHEDULE property - "replace"

SPECIAL

public static final String SPECIAL
An "svn:special" SVN special property.

SVN_ENTRY_PREFIX

public static final String SVN_ENTRY_PREFIX
An "svn:entry:" prefix.

SVN_PREFIX

public static final String SVN_PREFIX
An "svn:" prefix.

SVN_WC_PREFIX

public static final String SVN_WC_PREFIX
An "svn:wc:" prefix.

TEXT_TIME

public static final String TEXT_TIME
An "svn:entry:text-time" SVN untweakable metaproperty.

TXN_CHECK_LOCKS

public static final String TXN_CHECK_LOCKS
A special property used in a commit transaction.

TXN_CHECK_OUT_OF_DATENESS

public static final String TXN_CHECK_OUT_OF_DATENESS
A special property used in a commit transaction.

URL

public static final String URL
An "svn:entry:url" SVN untweakable metaproperty.

UUID

public static final String UUID
An "svn:entry:uuid" SVN untweakable metaproperty.

WC_URL

public static final String WC_URL
An "svn:wc:ra_dav:version-url" SVN untweakable metaproperty.

Method Detail

booleanValue

public static boolean booleanValue(String text)
Converts a string representation of a boolean value to boolean. Useful to convert values of the COPIED property.

Parameters: text a string to convert to a boolean value

Returns: true if and only if text is not null and is equal, ignoring case, to the string "true"

getEOLBytes

public static byte[] getEOLBytes(String eolType)
Returns eol-marker bytes according to the given eol type.

Parameters: eolType a requested eol-marker type (platform specific)

Returns: null if eolType is null, or an array of bytes for one of the four possible eol types

See Also: EOL_STYLE_CR EOL_STYLE_CRLF EOL_STYLE_LF EOL_STYLE_NATIVE

getValueOfBooleanProperty

public static String getValueOfBooleanProperty(String propName)
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

isBinaryMimeType

public static boolean isBinaryMimeType(String mimeType)
Says if the given MIME-type corresponds to a binary (non-textual) type.

Parameters: mimeType a value of a file MIME_TYPE property

Returns: true if mimeType is not a text type

See Also: isTextMimeType

isBooleanProperty

public static boolean isBooleanProperty(String propName)
Checks whether the property is boolean.

Parameters: propName a property name

Returns: true if boolean, otherwise false

Since: 1.1

isEntryProperty

public static boolean isEntryProperty(String name)
Says if the given property name starts with the SVN_ENTRY_PREFIX prefix.

Parameters: name a property name to check

Returns: true if name is not null and starts with the SVN_ENTRY_PREFIX prefix, otherwise false

isRegularProperty

public static boolean isRegularProperty(String name)
Checks if a property is regular. Regular are some "svn:" properties and all user props, i.e. ones stored in the repository filesystem.

Parameters: name a property name

Returns: true if regular, otherwise false

isSVNProperty

public static boolean isSVNProperty(String name)
Says if the given property name starts with the SVN_PREFIX prefix.

Parameters: name a property name to check

Returns: true if name is not null and starts with the SVN_PREFIX prefix, otherwise false

isTextMimeType

public static boolean isTextMimeType(String mimeType)
Says if the given MIME-type corresponds to a text type.

Parameters: mimeType a value of a file MIME_TYPE property

Returns: true if mimeType is either null or is a text type (starts with "text/")

See Also: isBinaryMimeType

isWorkingCopyProperty

public static boolean isWorkingCopyProperty(String name)
Says if the given property name starts with the SVN_WC_PREFIX prefix.

Parameters: name a property name to check

Returns: true if name is not null and starts with the SVN_WC_PREFIX prefix, otherwise false

longValue

public static long longValue(String text)
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

shortPropertyName

public static String shortPropertyName(String longName)
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

toString

public static String toString(boolean b)
Converts a boolean value to a string representation. Useful to convert values of the COPIED property.

Parameters: b a boolean value

Returns: a string representation of b

toString

public static String toString(long i)
Converts a long value to a string representation. Useful to convert revision numbers.

Parameters: i a long value

Returns: a string representation of i

Copyright © 2004-2007 TMate Software Ltd. All Rights Reserved.