Package org.gcube.smartgears.utils
Class Utils
- java.lang.Object
-
- org.gcube.smartgears.utils.Utils
-
public class Utils extends Object
Library-wide utils.- Author:
- Fabio Simeoni
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceUtils.ModeClause
-
Field Summary
Fields Modifier and Type Field Description static ScheduledExecutorServicescheduledServicePool
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseSafely(Closeable c)static Utils.ModeClausefileAt(String path)static ThrowablegetCause(Throwable e)static org.gcube.common.authorization.library.provider.ServiceInfogetServiceInfo(ApplicationContext application)static voidhandleError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Throwable t)static Stringhome()static voidnotEmpty(String name, Object[] o)static voidnotEmpty(String name, String o)static voidnotEmpty(String name, Collection<?> o)static voidnotNull(Object[] o)static voidnotNull(String name, Object o)static voidrethrowUnchecked(Throwable t)static StringsmartgearsVersion()static RuntimeExceptionunchecked(Throwable t)static voidvalid(String name, Object[] o)static voidvalid(String name, String o)
-
-
-
Field Detail
-
scheduledServicePool
public static final ScheduledExecutorService scheduledServicePool
-
-
Method Detail
-
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
-
fileAt
public static Utils.ModeClause fileAt(String path)
-
getServiceInfo
public static org.gcube.common.authorization.library.provider.ServiceInfo getServiceInfo(ApplicationContext application)
-
-