org.gcube.smartgears.utils
Class Utils

java.lang.Object
  extended by org.gcube.smartgears.utils.Utils

public class Utils
extends Object

Library-wide utils.

Author:
Fabio Simeoni

Constructor Summary
Utils()
           
 
Method Summary
static void closeSafely(Closeable c)
           
static void handleError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Throwable t)
           
static String home()
           
static boolean isResource(javax.servlet.ServletContext application)
           
static void notEmpty(String name, Collection<?> o)
           
static void notEmpty(String name, Object[] o)
           
static void notEmpty(String name, String o)
           
static void notNull(Object[] o)
           
static void notNull(String name, Object o)
           
static void rethrowUnchecked(Throwable t)
           
static String smartgearsVersion()
           
static RuntimeException unchecked(Throwable t)
           
static void valid(String name, Object[] o)
           
static void valid(String name, String o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

isResource

public static boolean isResource(javax.servlet.ServletContext application)

unchecked

public static RuntimeException unchecked(Throwable t)

smartgearsVersion

public static String smartgearsVersion()

rethrowUnchecked

public static void rethrowUnchecked(Throwable t)
                             throws RuntimeException
Throws:
RuntimeException

closeSafely

public static void closeSafely(Closeable c)

valid

public static void valid(String name,
                         Object[] o)
                  throws IllegalArgumentException
Throws:
IllegalArgumentException

notNull

public static void notNull(Object[] o)
                    throws IllegalArgumentException
Throws:
IllegalArgumentException

notNull

public static void notNull(String name,
                           Object o)
                    throws IllegalArgumentException
Throws:
IllegalArgumentException

notEmpty

public static void notEmpty(String name,
                            String o)
                     throws IllegalArgumentException
Throws:
IllegalArgumentException

notEmpty

public static void notEmpty(String name,
                            Object[] o)
                     throws IllegalArgumentException
Throws:
IllegalArgumentException

notEmpty

public static void notEmpty(String name,
                            Collection<?> o)
                     throws IllegalArgumentException
Throws:
IllegalArgumentException

valid

public static void valid(String name,
                         String o)
                  throws IllegalArgumentException
Throws:
IllegalArgumentException

home

public static String home()

handleError

public static void handleError(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               Throwable t)
                        throws IOException
Throws:
IOException


Copyright © 2013. All Rights Reserved.