com.googlecode.sardine.util
Class SardineUtil

java.lang.Object
  extended by com.googlecode.sardine.util.SardineUtil

public class SardineUtil
extends java.lang.Object

Basic utility code. I borrowed some code from the webdavlib for parsing dates.

Author:
jonstevens

Nested Class Summary
static class SardineUtil.HttpCopy
          Simple class for making copy a bit easier to deal with.
static class SardineUtil.HttpMkCol
          Simple class for making mkcol a bit easier to deal with.
static class SardineUtil.HttpMove
          Simple class for making move a bit easier to deal with.
static class SardineUtil.HttpPropFind
          Simple class for making propfind a bit easier to deal with.
 
Constructor Summary
SardineUtil()
           
 
Method Summary
static org.apache.http.entity.StringEntity createDirectoryEntity()
          Stupid wrapper cause it needs to be in a try/catch
static java.lang.String decode(java.lang.String value)
          Hides the irritating declared exception.
static java.lang.String encode(java.lang.String value)
          Hides the irritating declared exception.
static Multistatus getMulitstatus(javax.xml.bind.Unmarshaller unmarshaller, org.apache.http.HttpResponse response, java.lang.String url)
          Helper method for getting the Multistatus response processor.
static org.apache.http.entity.StringEntity getResourcesEntity()
          Stupid wrapper cause it needs to be in a try/catch
static boolean isGoodResponse(int statusCode)
          Is the status code 2xx
static java.util.Date parseDate(java.lang.String dateValue)
          Loops over all the possible date formats and tries to find the right one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SardineUtil

public SardineUtil()
Method Detail

encode

public static java.lang.String encode(java.lang.String value)
Hides the irritating declared exception.


decode

public static java.lang.String decode(java.lang.String value)
Hides the irritating declared exception.

Returns:
null if there is an IllegalArgumentException
Throws:
java.lang.RuntimeException - if there is an UnsupportedEncodingException

parseDate

public static java.util.Date parseDate(java.lang.String dateValue)
Loops over all the possible date formats and tries to find the right one.

Parameters:
dateValue -

isGoodResponse

public static boolean isGoodResponse(int statusCode)
Is the status code 2xx


getResourcesEntity

public static org.apache.http.entity.StringEntity getResourcesEntity()
Stupid wrapper cause it needs to be in a try/catch


createDirectoryEntity

public static org.apache.http.entity.StringEntity createDirectoryEntity()
Stupid wrapper cause it needs to be in a try/catch


getMulitstatus

public static Multistatus getMulitstatus(javax.xml.bind.Unmarshaller unmarshaller,
                                         org.apache.http.HttpResponse response,
                                         java.lang.String url)
                                  throws SardineException
Helper method for getting the Multistatus response processor.

Throws:
SardineException


Copyright © 2010 Jon Stevens and a gang of smelly fish. All Rights Reserved. Build version: 39