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.
  • Field Details

  • Method Details

    • parseDate

      public static Date parseDate(String value)
      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

      public static <T> T unmarshal(InputStream in) throws IOException
      Throws:
      IOException
    • toXml

      public static String toXml(Object jaxbElement) throws IOException
      Parameters:
      jaxbElement - An object from the model
      Returns:
      The XML string for the WebDAV request
      Throws:
      RuntimeException - When there is a JAXB error
      IOException
    • toQName

      public static Map<QName,String> toQName(Map<String,String> setProps)
    • toQName

      public static List<QName> toQName(List<String> removeProps)
    • toQName

      public static QName toQName(Element element)
    • createQNameWithCustomNamespace

      public static QName createQNameWithCustomNamespace(String key)
      Parameters:
      key - Local element name.
    • createQNameWithDefaultNamespace

      public static QName createQNameWithDefaultNamespace(String key)
      Parameters:
      key - Local element name.
    • createElement

      public static Element createElement(QName key)
      Parameters:
      key - Fully qualified element name.
    • createElement

      public static Element createElement(Element parent, QName key)
      Parameters:
      key - Fully qualified element name.