Package com.github.sardine.util
Class SardineUtil
java.lang.Object
com.github.sardine.util.SardineUtil
public final class SardineUtil extends Object
Basic utility code. I borrowed some code from the webdavlib for
parsing dates.
- Author:
- jonstevens
-
Field Summary
Fields Modifier and Type Field Description static StringCUSTOM_NAMESPACE_PREFIXDefault namespace prefixstatic StringCUSTOM_NAMESPACE_URIDefault namespace URIstatic StringDEFAULT_NAMESPACE_PREFIXDefault namespace prefixstatic StringDEFAULT_NAMESPACE_URIDefault namespace URI -
Method Summary
Modifier and Type Method Description static ElementcreateElement(QName key)static ElementcreateElement(Element parent, QName key)static QNamecreateQNameWithCustomNamespace(String key)static QNamecreateQNameWithDefaultNamespace(String key)static DateparseDate(String value)Loops over all the possible date formats and tries to find the right one.static List<QName>toQName(List<String> removeProps)static Map<QName,String>toQName(Map<String,String> setProps)static QNametoQName(Element element)static StringtoXml(Object jaxbElement)static <T> Tunmarshal(InputStream in)
-
Field Details
-
CUSTOM_NAMESPACE_PREFIX
Default namespace prefix- See Also:
- Constant Field Values
-
CUSTOM_NAMESPACE_URI
Default namespace URI- See Also:
- Constant Field Values
-
DEFAULT_NAMESPACE_PREFIX
Default namespace prefix- See Also:
- Constant Field Values
-
DEFAULT_NAMESPACE_URI
Default namespace URI- See Also:
- Constant Field Values
-
-
Method Details
-
parseDate
Loops over all the possible date formats and tries to find the right one.- Parameters:
value- ISO date string- Returns:
- Null if there is a parsing failure
-
unmarshal
- Throws:
IOException
-
toXml
- Parameters:
jaxbElement- An object from the model- Returns:
- The XML string for the WebDAV request
- Throws:
RuntimeException- When there is a JAXB errorIOException
-
toQName
-
toQName
-
toQName
-
createQNameWithCustomNamespace
- Parameters:
key- Local element name.
-
createQNameWithDefaultNamespace
- Parameters:
key- Local element name.
-
createElement
- Parameters:
key- Fully qualified element name.
-
createElement
- Parameters:
key- Fully qualified element name.
-