|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sf.jlaunchpad.util.FileUtil
public final class FileUtil
This is the class for holding file utilities.
Constructor Summary | |
---|---|
FileUtil()
|
Method Summary | |
---|---|
static void |
copy(java.io.InputStream is,
java.io.OutputStream os)
|
static void |
copyFile(java.io.InputStream in,
java.lang.String fileName)
|
static void |
copyFile(java.lang.String fileName,
java.io.OutputStream out)
|
static java.io.File |
copyToFile(java.io.InputStream is,
java.io.File file)
Copies the stream to the temporary file. |
static java.io.File |
copyToTempFile(java.io.InputStream is,
java.lang.String prefix,
java.lang.String suffix)
Copies the stream to the temporary file. |
static java.lang.String |
getExtension(java.io.File file)
Conveinience method that returns the "dot" extension for the given file. |
static java.lang.String |
getExtension(java.lang.String fileName)
Conveinience method that returns the "dot" extension for the given file. |
static java.io.File |
getFileFromArchive(java.lang.String jarFileName,
java.lang.String location,
java.lang.String prefix,
java.lang.String suffix)
Gets the Ant project file located inside jar file. |
static java.util.jar.Manifest |
getManifest(java.util.jar.JarFile jarFile)
Gets the manifest object from jar file. |
static java.util.jar.Manifest |
getManifest(java.lang.String jarFileName)
Gets the manifest object from jar file. |
static byte[] |
getStreamAsBytes(java.io.InputStream is)
Converst input stream into the byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtil()
Method Detail |
---|
public static java.io.File copyToFile(java.io.InputStream is, java.io.File file) throws java.io.IOException
is
- the input streamfile
- the file
java.io.IOException
- I/O Exceptionpublic static void copyFile(java.lang.String fileName, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.InputStream in, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static java.io.File copyToTempFile(java.io.InputStream is, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
is
- the input streamprefix
- the prefix part of the file namesuffix
- the suffix part of the file name
java.io.IOException
- I/O Exceptionpublic static java.util.jar.Manifest getManifest(java.lang.String jarFileName) throws java.io.IOException
jarFileName
- the jar file name
java.io.IOException
- I/O Exceptionpublic static java.util.jar.Manifest getManifest(java.util.jar.JarFile jarFile) throws java.io.IOException
jarFile
- the jar file
java.io.IOException
- I/O Exceptionpublic static byte[] getStreamAsBytes(java.io.InputStream is) throws java.io.IOException
is
- the input stream
java.io.IOException
- the I/O exceptionpublic static java.io.File getFileFromArchive(java.lang.String jarFileName, java.lang.String location, java.lang.String prefix, java.lang.String suffix) throws java.io.IOException
jarFileName
- the name of jar filelocation
- the locationprefix
- the preficsuffix
- the suffix
java.io.IOException
- I/O Exceptionpublic static java.lang.String getExtension(java.io.File file)
file
- the file
public static java.lang.String getExtension(java.lang.String fileName)
fileName
- the file name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |