org.gcube.contentmanagement.timeseriesservice.impl.utils
Class Util

java.lang.Object
  extended by org.gcube.contentmanagement.timeseriesservice.impl.utils.Util

public class Util
extends Object


Field Summary
static SimpleDateFormat dateFormatter
           
 
Constructor Summary
Util()
           
 
Method Summary
static void getZip(OutputStream os, String name, InputStream is)
           
static org.gcube.common.dbinterface.types.Type.Types mapJavaToSql(DataType sqlType)
           
static DataType mapSqlToJava(org.gcube.common.dbinterface.types.Type.Types type)
           
protected static String quote(String string)
          Produce a string in double quotes with backslash sequences in all the right places.
static String removeSizeFromDBType(String typeName)
           
static String replaceKeyType(String type)
           
static void streamToFile(InputStream instream, OutputStream out)
           
static String toJSon(ResultSet resultSet)
           
static void unzip(InputStream is, OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateFormatter

public static SimpleDateFormat dateFormatter
Constructor Detail

Util

public Util()
Method Detail

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
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.