|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oozie.util.IOUtils
public abstract class IOUtils
IO Utility methods.
| Constructor Summary | |
|---|---|
IOUtils()
|
|
| Method Summary | |
|---|---|
static void |
copyCharStream(Reader reader,
Writer writer)
Copies an char input stream into an char output stream. |
static void |
copyStream(InputStream is,
OutputStream os)
Copies an inputstream into an output stream. |
static File |
createJar(File baseDir,
String jarName,
Class... classes)
Creates a JAR file with the specified classes. |
static void |
delete(File file)
Delete recursively a local directory. |
static String |
getReaderAsString(Reader reader,
int maxLen)
Return a reader as string. |
static Reader |
getResourceAsReader(String path,
int maxLen)
Return a classpath resource as a reader. |
static InputStream |
getResourceAsStream(String path,
int maxLen)
Return a classpath resource as a stream. |
static String |
getResourceAsString(String path,
int maxLen)
Return a classpath resource as string. |
static void |
zipDir(File dir,
String relativePath,
ZipOutputStream zos)
Zips a local directory, recursively, into a ZIP stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IOUtils()
| Method Detail |
|---|
public static void delete(File file)
throws IOException
file - directory to delete.
IOException - thrown if the directory could not be deleted.
public static String getReaderAsString(Reader reader,
int maxLen)
throws IOException
reader - reader to read into a string.maxLen - max content length allowed, if -1 there is no limit.
IOException - thrown if the resource could not be read.
public static InputStream getResourceAsStream(String path,
int maxLen)
throws IOException
path - classpath for the resource.maxLen - max content length allowed.
IOException - thrown if the resource could not be read.
public static Reader getResourceAsReader(String path,
int maxLen)
throws IOException
path - classpath for the resource.maxLen - max content length allowed.
IOException - thrown if the resource could not be read.
public static String getResourceAsString(String path,
int maxLen)
throws IOException
path - classpath for the resource.maxLen - max content length allowed.
IOException - thrown if the resource could not be read.
public static void copyStream(InputStream is,
OutputStream os)
throws IOException
is - inputstream to copy from.os - outputstream to copy to.
IOException - thrown if the copy failed.
public static void copyCharStream(Reader reader,
Writer writer)
throws IOException
reader - reader to copy from.writer - writer to copy to.
IOException - thrown if the copy failed.
public static void zipDir(File dir,
String relativePath,
ZipOutputStream zos)
throws IOException
dir - directory to ZIP.relativePath - basePath in the ZIP for the files, normally "/".zos - the ZIP output stream to ZIP the directory.
IOException - thrown if the directory could not be zipped.
public static File createJar(File baseDir,
String jarName,
Class... classes)
throws IOException
baseDir - local directory to create the JAR file, the staging 'classes' directory is created in there.jarName - JAR file name, including extesion.classes - classes to add to the JAR.
IOException - thrown if the JAR file could not be created.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||