org.codegist.crest
Class Params

java.lang.Object
  extended by org.codegist.crest.Params

public final class Params
extends Object

Author:
Laurent Gilles (laurent.gilles@codegist.org)

Method Summary
static String encodeParams(Map<String,Object> params, String encoding)
          Encode the given parameter map into a string for HTTP body content
static boolean isForUpload(Collection<Object> os)
          Returns true if any of the given collection of object is considered for upload (File or InputStream)
static boolean isForUpload(Map<String,Object> params)
          Returns true if any of the given params of object is considered for upload (File or InputStream)
static boolean isForUpload(Object o)
          Returns true if the given object is considered for upload (File or InputStream)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isForUpload

public static boolean isForUpload(Collection<Object> os)
Returns true if any of the given collection of object is considered for upload (File or InputStream)

Parameters:
os - Collection of objects
Returns:
flag indicating if the given list contains values to upload

isForUpload

public static boolean isForUpload(Map<String,Object> params)
Returns true if any of the given params of object is considered for upload (File or InputStream)

Parameters:
params - Map of objects
Returns:
flag indicating if the given map contains values to upload

isForUpload

public static boolean isForUpload(Object o)
Returns true if the given object is considered for upload (File or InputStream)

Parameters:
o - Object to test
Returns:
flag indicating if the given object is for upload

encodeParams

public static String encodeParams(Map<String,Object> params,
                                  String encoding)
                           throws UnsupportedEncodingException
Encode the given parameter map into a string for HTTP body content

Parameters:
params - Parameter map
encoding - Encoding
Returns:
the encoding representation string of the given parameter map
Throws:
UnsupportedEncodingException - Encoding is not supported


Copyright © 2011. All Rights Reserved.