org.gwe.utils
Class IOUtils

java.lang.Object
  extended by org.gwe.utils.IOUtils

public class IOUtils
extends java.lang.Object

Since:
Jun 13, 2007
Author:
Marco Ruiz

Field Summary
static java.lang.String FILE_SEPARATOR
           
 
Constructor Summary
IOUtils()
           
 
Method Summary
static java.lang.String concatenate(java.lang.Object... args)
           
static java.lang.String concatenatePaths(java.lang.Object... paths)
           
static java.lang.String concatenatePaths(java.lang.String filePath, java.lang.String fileName)
           
static void copyFile(java.io.File in, java.io.File out)
           
static java.lang.String createLocalExecutableFile(java.lang.String fullFileName, java.lang.String contents)
           
static void createLocalFolder(java.lang.String fullPath)
           
static
<T> T
deserializeObject(byte[] stream)
           
static
<T> T
deserializeObject(java.io.InputStream is)
           
static java.lang.String getFileBase(java.lang.String uriStr)
           
static java.lang.String getFileName(java.lang.String file)
           
static java.lang.String getFilePath(java.lang.String file)
           
static boolean makeFilePath(java.lang.String file)
           
static int pipeStreams(java.io.InputStream is, java.io.OutputStream os)
           
static int pipeStreams(java.io.InputStream is, java.io.OutputStream os, boolean closeStreams)
           
static int pipeStreams(java.io.InputStream is, java.util.Set<java.io.OutputStream> osSet, boolean closeStreams, java.lang.String endTag)
           
static java.lang.String readClassPathFile(java.lang.String fileName)
           
static java.lang.String readFile(java.io.File f)
           
static byte[] readFile(java.lang.String filename)
           
static java.lang.String readReader(java.io.InputStreamReader fr)
           
static java.lang.String readStream(java.io.InputStream is)
           
static java.io.ByteArrayOutputStream readStream(java.io.InputStream is, java.io.OutputStream myOs)
           
static java.io.ByteArrayOutputStream readStream(java.io.InputStream is, java.io.OutputStream myOs, java.lang.String endTag)
           
static void serializeObject(java.lang.Object obj, java.io.OutputStream os)
           
static void serializeObject(java.lang.Object obj, java.lang.String fileName)
           
static
<T> byte[]
serializeObject(T obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_SEPARATOR

public static final java.lang.String FILE_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

IOUtils

public IOUtils()
Method Detail

makeFilePath

public static boolean makeFilePath(java.lang.String file)

copyFile

public static void copyFile(java.io.File in,
                            java.io.File out)
                     throws java.io.IOException
Throws:
java.io.IOException

getFileBase

public static java.lang.String getFileBase(java.lang.String uriStr)

getFileName

public static java.lang.String getFileName(java.lang.String file)

getFilePath

public static java.lang.String getFilePath(java.lang.String file)

createLocalFolder

public static void createLocalFolder(java.lang.String fullPath)

createLocalExecutableFile

public static java.lang.String createLocalExecutableFile(java.lang.String fullFileName,
                                                         java.lang.String contents)
                                                  throws java.io.IOException
Throws:
java.io.IOException

concatenatePaths

public static java.lang.String concatenatePaths(java.lang.Object... paths)

concatenatePaths

public static java.lang.String concatenatePaths(java.lang.String filePath,
                                                java.lang.String fileName)

concatenate

public static java.lang.String concatenate(java.lang.Object... args)

readFile

public static java.lang.String readFile(java.io.File f)
                                 throws java.io.FileNotFoundException,
                                        java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readReader

public static java.lang.String readReader(java.io.InputStreamReader fr)
                                   throws java.io.IOException
Throws:
java.io.IOException

readFile

public static byte[] readFile(java.lang.String filename)
                       throws java.io.IOException,
                              java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

readClassPathFile

public static java.lang.String readClassPathFile(java.lang.String fileName)

pipeStreams

public static int pipeStreams(java.io.InputStream is,
                              java.io.OutputStream os)
                       throws java.io.IOException
Throws:
java.io.IOException

readStream

public static java.io.ByteArrayOutputStream readStream(java.io.InputStream is,
                                                       java.io.OutputStream myOs)
                                                throws java.io.IOException
Throws:
java.io.IOException

readStream

public static java.lang.String readStream(java.io.InputStream is)
                                   throws java.io.IOException
Throws:
java.io.IOException

readStream

public static java.io.ByteArrayOutputStream readStream(java.io.InputStream is,
                                                       java.io.OutputStream myOs,
                                                       java.lang.String endTag)
                                                throws java.io.IOException
Throws:
java.io.IOException

pipeStreams

public static int pipeStreams(java.io.InputStream is,
                              java.io.OutputStream os,
                              boolean closeStreams)
                       throws java.io.IOException
Throws:
java.io.IOException

pipeStreams

public static int pipeStreams(java.io.InputStream is,
                              java.util.Set<java.io.OutputStream> osSet,
                              boolean closeStreams,
                              java.lang.String endTag)
                       throws java.io.IOException
Throws:
java.io.IOException

serializeObject

public static void serializeObject(java.lang.Object obj,
                                   java.lang.String fileName)
                            throws java.io.IOException
Throws:
java.io.IOException

serializeObject

public static void serializeObject(java.lang.Object obj,
                                   java.io.OutputStream os)
                            throws java.io.IOException
Throws:
java.io.IOException

serializeObject

public static <T> byte[] serializeObject(T obj)
                              throws java.io.IOException
Throws:
java.io.IOException

deserializeObject

public static <T> T deserializeObject(byte[] stream)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

deserializeObject

public static <T> T deserializeObject(java.io.InputStream is)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 2007-2009. All Rights Reserved.