|
| Foundation |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.services.webdav.Utils
@SASScope(value="ALL") @BinaryCompatibilityOnly public class Utils
A convenience class to bring together a number of utilities.
| Field Summary | |
|---|---|
static int |
PATH_KEY
|
static int |
URL_KEY
|
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
addSegment(java.lang.String path,
java.lang.String segment)
Append a segment to a path. |
static java.lang.String |
bytesToHex(byte[] chars)
Convert a byte array to a hex representation that is easy to visualize. |
static java.lang.String |
byteStreamToHex(java.io.InputStream byteStream)
Convert a stream of bytes to hex. |
static java.lang.String |
CDATA(java.lang.String text)
Encapsulate the text in a CDATA section in case there is any markup in text. |
static PropertyMap |
convertDavPropertyArray(java.util.List<DavPropertyItem> davPropertyItems)
|
static java.lang.String |
getHostPort(DAVResource r)
|
static java.lang.String |
getRelativePath(java.lang.String urlString)
Get the relative path for a given URL. |
static java.lang.String |
intToHex(int number,
int width)
Convert an int to printable hex format (e.g. 33 = x'21') padding if necessary. |
static boolean |
isCollection(java.util.Map properties)
A utility method to check through a set of properties and determine if it is a collection or not. |
static boolean |
isSameUrl(java.lang.String url1,
java.lang.String url2)
Compare two URL strings. |
static void |
print(java.lang.String a)
|
static java.lang.String |
stringToHex(java.lang.String chars)
Convert a set of characters to hex. |
static java.lang.String |
stripLeadingSlashes(java.lang.String buffer)
Strip off leading forward slash characters |
static java.util.Map |
transformDavProperties(java.lang.String url,
java.util.List<DavPropertyItem> davPropertyItems,
int key)
|
static java.lang.String |
transformURL(java.lang.String targetUrl,
java.lang.String originUrl)
|
static java.lang.String |
URIDecode(java.lang.String uriString)
Decodes a URI and produces a Java string user version of the URI. |
static java.lang.String |
URIDecode(java.lang.String uriString,
boolean forcePort)
Decodes a URI and produces a Java string user version of the URI. |
static java.lang.String |
XMLESCAPE(java.lang.String text)
Escape the characters '<', '&', '>' and '"', which shouldn't appear in literal form except as markup (unless they are in a CDATA section). |
| Field Detail |
|---|
public static final int PATH_KEY
public static final int URL_KEY
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static java.lang.String bytesToHex(byte[] chars)
chars - The byte array to convert to hex display
public static java.lang.String byteStreamToHex(java.io.InputStream byteStream)
byteStream - A stream containing the bytes to convert
public static java.lang.String stringToHex(java.lang.String chars)
chars - A string containing the characters to convert
public static java.lang.String intToHex(int number,
int width)
number - The number to be convertedwidth - The width of the resulting string
public static boolean isSameUrl(java.lang.String url1,
java.lang.String url2)
url1 - The first URL stringurl2 - The second URL string
public static boolean isCollection(java.util.Map properties)
properties - The property map for this resource.
public static PropertyMap convertDavPropertyArray(java.util.List<DavPropertyItem> davPropertyItems)
throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationExceptionpublic static java.lang.String getRelativePath(java.lang.String urlString)
urlString - A string representing a URL
public static java.lang.String addSegment(java.lang.String path,
java.lang.String segment)
Concatenate the segment to the path with a slash in between. This routine takes into account all the nasties, including blanks before or after the slashes, empty segment or path, multiple slashes, and missing slashes.
path - The path (or URL)segment - The segment to be added to the path
public static java.lang.String CDATA(java.lang.String text)
text - The text to be encapsulated
public static java.lang.String XMLESCAPE(java.lang.String text)
text - The text to be escaped
public static java.lang.String stripLeadingSlashes(java.lang.String buffer)
buffer - Initial string from which to remove leading slashes
public static void print(java.lang.String a)
public static java.lang.String URIDecode(java.lang.String uriString)
uriString - The actual URI (absolute or relative)
public static java.lang.String URIDecode(java.lang.String uriString,
boolean forcePort)
uriString - The actual URI (absolute or relative)
public static java.lang.String getHostPort(DAVResource r)
public static java.util.Map transformDavProperties(java.lang.String url,
java.util.List<DavPropertyItem> davPropertyItems,
int key)
throws DAVException,
java.rmi.RemoteException,
javax.xml.parsers.ParserConfigurationException
DAVException
java.rmi.RemoteException
javax.xml.parsers.ParserConfigurationException
public static java.lang.String transformURL(java.lang.String targetUrl,
java.lang.String originUrl)
throws DAVException
DAVException
|
| Foundation |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||