|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.FileUtil
public final class FileUtil
The FileUtil contains file and filename dependent
utility methods.
| Method Summary | |
|---|---|
static long |
copy(File pSource,
File pTarget)
Copies one file into another file using java.nio Channels. |
static long |
copy(InputStream pIn,
boolean pCloseIn,
OutputStream pOut,
boolean pCloseOut)
Copies the content of an InputStream to the desired OutputStream. |
static long |
copy(InputStream pIn,
OutputStream pOut)
Copies the content of an InputStream to the desired OutputStream. |
static byte[] |
getContent(InputStream pStream)
Reads the content of an InputStream into a byte array. |
static byte[] |
getContent(InputStreamReader pReader)
Reads the content of an InputStreamReader into a byte array. |
static String |
getExtension(String pPath)
Gets the extension of an absolute file path. |
static String |
getName(String pAbsolutePath)
Gets the name of a file from an absolute path. |
static File |
getNotExistingFile(File pFile)
Gets a file that does not exist. |
static String |
removeExtension(String pPath)
Removes the file extension from a file name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static long copy(InputStream pIn,
OutputStream pOut)
throws IOException
InputStream to the desired OutputStream.
pIn - input stream with contentpOut - output stream
IOException - if it's not possible to read from the InputStream
or write to the OutputStream
public static long copy(InputStream pIn,
boolean pCloseIn,
OutputStream pOut,
boolean pCloseOut)
throws IOException
InputStream to the desired OutputStream.
pIn - input stream with contentpCloseIn - true, if the input streampOut - output streampCloseOut - true, if the output stream
IOException - if it's not possible to read from the InputStream
or write to the OutputStream
public static long copy(File pSource,
File pTarget)
throws IOException
java.nio Channels.
pSource - source filepTarget - target file
IOException - if it's not possible to copy the filepublic static byte[] getContent(InputStream pStream)
InputStream into a byte array.
pStream - the input stream
public static byte[] getContent(InputStreamReader pReader)
InputStreamReader into a byte array.
pReader - the input stream reader
public static String removeExtension(String pPath)
pPath - the filename
public static String getExtension(String pPath)
pPath - the absolute path of a file
null if the path is null
or has no extensionpublic static File getNotExistingFile(File pFile)
pFile - the desired file name
public static String getName(String pAbsolutePath)
pAbsolutePath - the absolute path for a file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||