org.gcube.contentmanagement.timeseriesservice.impl.utils
Class Util
java.lang.Object
org.gcube.contentmanagement.timeseriesservice.impl.utils.Util
public class Util
- extends Object
|
Constructor Summary |
Util()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dateFormatter
public static SimpleDateFormat dateFormatter
Util
public Util()
toJSon
public static String toJSon(ResultSet resultSet)
throws SQLException
- Throws:
SQLException
quote
protected static String quote(String string)
- Produce a string in double quotes with backslash sequences in all the
right places. A backslash will be inserted within , allowing JSON
text to be delivered in HTML. In JSON text, a string cannot contain a
control character or an unescaped quote or backslash.
- Parameters:
string - A String
- Returns:
- A String correctly formatted for insertion in a JSON text.
streamToFile
public static void streamToFile(InputStream instream,
OutputStream out)
throws Exception
- Throws:
Exception
unzip
public static void unzip(InputStream is,
OutputStream os)
throws Exception
- Parameters:
is - the zip stream.os - the output stream.
- Throws:
Exception
getZip
public static void getZip(OutputStream os,
String name,
InputStream is)
throws Exception
- Throws:
Exception
removeSizeFromDBType
public static String removeSizeFromDBType(String typeName)
mapSqlToJava
public static DataType mapSqlToJava(org.gcube.common.dbinterface.types.Type.Types type)
throws Exception
- Throws:
Exception
mapJavaToSql
public static org.gcube.common.dbinterface.types.Type.Types mapJavaToSql(DataType sqlType)
replaceKeyType
public static String replaceKeyType(String type)
throws Exception
- Throws:
Exception
Copyright © 2012. All Rights Reserved.