|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.util.ResourceUtil
public final class ResourceUtil
Util for files and streams.
Constructor Summary | |
---|---|
ResourceUtil()
|
Method Summary | |
---|---|
static void |
copy(File in,
File out)
Copies the contents of the input file to the output file. |
static void |
copy(InputStream in,
OutputStream out)
Copies the contents of the input stream to the output stream. |
static void |
copy(InputStream in,
OutputStream out,
int bufferSize)
Copies the contents of the input stream to the output stream with the specified buffer size to use for copying. |
static void |
copy(URL in,
File out)
Copies the contents of the input url to the output file. |
static void |
copy(URL in,
URL out)
Copies the contents of the input url to the output url. |
static void |
copyFileToDir(File file,
File dirTo)
Copies the given file to the given dir. |
static ByteArrayOutputStream |
getByteArrayOutputStream(InputStream in)
Gets the ByteArrayOutputStream that was filled when reading from the given input stream in . |
static int |
getCopyBufferSize()
Gets the buffer size to use when copying data from streams. |
static List<File> |
getFilesByExtension(File dir,
String[] extensions)
Returns a list of file filtered by their file types/extensions; (E.g ".zip") |
static byte[] |
readBytes(File file)
Reads the contents of the file into a byte array. |
static byte[] |
readBytes(InputStream in)
Reads the contents of the given input stream into a byte array. |
static byte[] |
readBytes(String file)
Reads the contents of the given file into a byte array. |
static byte[] |
readBytes(URI file)
Reads the contents of the given file into a byte array. |
static byte[] |
readBytes(URL file)
Reads the contents of the given file into a byte array. |
static void |
setCopyBufferSize(int size)
Sets the buffer size to use when copying data from streams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceUtil()
Method Detail |
---|
public static void setCopyBufferSize(int size)
public static int getCopyBufferSize()
public static byte[] readBytes(File file) throws IOException
IOException
public static byte[] readBytes(String file) throws IOException
IOException
public static byte[] readBytes(URI file) throws IOException
IOException
public static byte[] readBytes(URL file) throws IOException
IOException
public static byte[] readBytes(InputStream in) throws IOException
IOException
public static ByteArrayOutputStream getByteArrayOutputStream(InputStream in) throws IOException
in
.
IOException
public static void copy(URL in, URL out) throws IOException
IOException
public static void copy(File in, File out) throws IOException
IOException
public static void copy(URL in, File out) throws IOException
IOException
public static void copy(InputStream in, OutputStream out) throws IOException
IOException
public static void copy(InputStream in, OutputStream out, int bufferSize) throws IOException
IOException
public static void copyFileToDir(File file, File dirTo) throws IOException
file
to the given dir.
IOException
public static List<File> getFilesByExtension(File dir, String[] extensions)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |