|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rapla.components.util.IOUtil
public abstract class IOUtil
Some IOHelper methods.
Constructor Summary | |
---|---|
IOUtil()
|
Method Summary | |
---|---|
static void |
copy(File srcFile,
File destFile,
boolean onlyOverwriteIfNewer)
copies a file. |
static void |
copy(String srcPath,
String destPath)
copies a file. |
static void |
copy(String srcPath,
String destPath,
boolean onlyOverwriteIfNewer)
copies a file. |
static void |
copyStreams(InputStream in,
OutputStream out)
copies the contents of the input stream to the output stream. |
static String |
decode(String s,
String enc)
same as URLDecoder.decode(java.lang.String) . |
static String |
encode(String s,
String enc)
same as URLEncoder.encode(java.lang.String) . |
static URL |
getBase(URL url)
returns the path of the url without the last path component |
static File |
getFileFrom(URL url)
|
static InputStream |
getInputStream(URL url)
returns a BufferedInputStream from the url. |
static File[] |
getJarFiles(String baseDir,
String dirList)
|
static String |
getRelativePath(File base,
File file)
returns the relative path of file to base. |
static String |
getRelativeURL(File base,
File file)
returns the relative path of file to base. |
static String |
getStackTraceAsString(Throwable ex)
|
static byte[] |
readBytes(URL url)
reads the content form an url into a ByteArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOUtil()
Method Detail |
---|
public static URL getBase(URL url)
public static byte[] readBytes(URL url) throws IOException
IOException
public static String decode(String s, String enc) throws UnsupportedEncodingException
URLDecoder.decode(java.lang.String)
.
But calls the deprecated method under 1.3.
UnsupportedEncodingException
public static String encode(String s, String enc) throws UnsupportedEncodingException
URLEncoder.encode(java.lang.String)
.
But calls the deprecated method under 1.3.
UnsupportedEncodingException
public static InputStream getInputStream(URL url) throws IOException
IOException
public static File getFileFrom(URL url) throws IOException
IOException
public static void copy(String srcPath, String destPath) throws IOException
srcPath
- the source-path. Thats the path of the file that should be copied.destPath
- the destination-path
IOException
public static void copy(String srcPath, String destPath, boolean onlyOverwriteIfNewer) throws IOException
srcPath
- the source-path. Thats the path of the file that should be copied.destPath
- the destination-path
IOException
public static void copy(File srcFile, File destFile, boolean onlyOverwriteIfNewer) throws IOException
IOException
public static void copyStreams(InputStream in, OutputStream out) throws IOException
in
- out
-
IOException
public static String getRelativePath(File base, File file) throws IOException
IOException
- if position of file is not relative to basepublic static String getRelativeURL(File base, File file) throws IOException
getRelativePath(File, File)
but replaces windows-plattform-specific
file separator \
with /
IOException
- if position of file is not relative to basepublic static File[] getJarFiles(String baseDir, String dirList) throws IOException
IOException
public static String getStackTraceAsString(Throwable ex)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |