com.dyuproject.util
Class ResourceUtil
java.lang.Object
com.dyuproject.util.ResourceUtil
public abstract class ResourceUtil
- extends Object
Util for files and streams.
- Author:
- David Yu
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
ResourceUtil
public ResourceUtil()
getCurrentPath
public static String getCurrentPath()
getBaseDir
public static File getBaseDir()
readBytes
public static byte[] readBytes(File file)
throws IOException
- Throws:
IOException
readBytes
public static byte[] readBytes(String file)
throws IOException
- Throws:
IOException
readBytes
public static byte[] readBytes(URI file)
throws IOException
- Throws:
IOException
readBytes
public static byte[] readBytes(URL file)
throws IOException
- Throws:
IOException
readBytes
public static byte[] readBytes(InputStream in)
throws IOException
- Throws:
IOException
getByteArrayOutputStream
public static ByteArrayOutputStream getByteArrayOutputStream(InputStream in)
throws IOException
- Throws:
IOException
copy
public static void copy(URL in,
URL out)
throws IOException
- Throws:
IOException
copy
public static void copy(File in,
File out)
throws IOException
- Throws:
IOException
copy
public static void copy(URL in,
File out)
throws IOException
- Throws:
IOException
copy
public static void copy(InputStream in,
OutputStream out)
throws IOException
- Throws:
IOException
copyFileToDir
public static void copyFileToDir(File file,
File dirTo)
throws IOException
- Throws:
IOException
getFilesByExtension
public static List<File> getFilesByExtension(File dir,
String[] extensions)
Copyright © 2013. All Rights Reserved.