com.simpy.api.rest.client
Class SimpyUtils

java.lang.Object
  extended bycom.simpy.api.rest.client.SimpyUtils

public class SimpyUtils
extends java.lang.Object

Utilities for Simpy Java API

Since:
1.0
Version:
$Id: SimpyUtils.java,v 1.3 2007/01/19 02:23:54 czarneckid Exp $
Author:
David Czarnecki

Constructor Summary
SimpyUtils()
           
 
Method Summary
static boolean checkNullOrBlank(java.lang.String input)
          Check to see if the input is null or blank
static java.lang.String encodeURL(java.lang.String input)
          Encode input with only for ?, &, and # characters
static java.lang.String encodeUTF8(java.lang.String input)
          Encode input using UTF-8
static java.util.Date getDateFromUTCString(java.lang.String time)
          Parse a date from a UTC string
static java.lang.String getSimpyDate(java.util.Date date)
          Return a date in Simpy style (yyyy-MM-dd)
static java.lang.String getUTCDate(java.util.Date date)
          Return a date in UTC style
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpyUtils

public SimpyUtils()
Method Detail

getUTCDate

public static java.lang.String getUTCDate(java.util.Date date)
Return a date in UTC style

Parameters:
date - Date
Returns:
Date formatted as ISO 8601

getSimpyDate

public static java.lang.String getSimpyDate(java.util.Date date)
Return a date in Simpy style (yyyy-MM-dd)

Parameters:
date - Date
Returns:
Date formatted as yyyy-MM-dd

getDateFromUTCString

public static java.util.Date getDateFromUTCString(java.lang.String time)
Parse a date from a UTC string

Parameters:
time - Input string of form yyyy-MM-ddTHH:mm:ssZ
Returns:
Date parsed from UTC string or null if error in parsing

checkNullOrBlank

public static boolean checkNullOrBlank(java.lang.String input)
Check to see if the input is null or blank

Parameters:
input - Input
Returns:
true if input is null or blank, false otherwise

encodeUTF8

public static java.lang.String encodeUTF8(java.lang.String input)
Encode input using UTF-8

Parameters:
input - Input
Returns:
Input encoded using UTF-8 or null if input was null

encodeURL

public static java.lang.String encodeURL(java.lang.String input)
Encode input with only for ?, &, and # characters

Parameters:
input - Input
Returns:
Input encoded changing ? to %3F, & to %26, and # to %23
Since:
1.3