org.gcube.portlets.user.td.gwtservice.server.file
Class FileUtil

java.lang.Object
  extended by org.gcube.portlets.user.td.gwtservice.server.file.FileUtil

public class FileUtil
extends Object


Field Summary
protected static org.slf4j.Logger logger
           
static String[] ZIP_MIMETYPES
           
 
Constructor Summary
FileUtil()
           
 
Method Summary
static String exceptionDetailMessage(Throwable t)
           
static boolean isZipContentType(String contentType)
          Check if the content type is a zip type.
static void setImportFile(FileUploadSession fileUploadSession, InputStream is, String name, String mimeType)
           
static String unZip(InputStream is, OutputStream os)
          Unzip the specified stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger

ZIP_MIMETYPES

public static final String[] ZIP_MIMETYPES
Constructor Detail

FileUtil

public FileUtil()
Method Detail

isZipContentType

public static boolean isZipContentType(String contentType)
Check if the content type is a zip type.

Parameters:
contentType - the content type to check.
Returns:
true if is a zip file, false otherwise.

unZip

public static String unZip(InputStream is,
                           OutputStream os)
                    throws Exception
Unzip the specified stream

Parameters:
is - the zip stream.
os - the output stream.
Throws:
Exception

exceptionDetailMessage

public static String exceptionDetailMessage(Throwable t)

setImportFile

public static void setImportFile(FileUploadSession fileUploadSession,
                                 InputStream is,
                                 String name,
                                 String mimeType)
                          throws Exception
Throws:
Exception


Copyright © 2013. All Rights Reserved.