| java.lang.Object org.jfree.io.IOUtils
IOUtils | public class IOUtils (Code) | | The IOUtils provide some IO related helper methods.
author: Thomas Morgner. |
Method Summary | |
public void | copyStreams(InputStream in, OutputStream out) Copies the InputStream into the OutputStream, until the end of the stream
has been reached. | public void | copyStreams(InputStream in, OutputStream out, int buffersize) Copies the InputStream into the OutputStream, until the end of the stream
has been reached. | public void | copyWriter(Reader in, Writer out) Copies the contents of the Reader into the Writer, until the end of the
stream has been reached. | public void | copyWriter(Reader in, Writer out, int buffersize) Copies the contents of the Reader into the Writer, until the end of the
stream has been reached. | public String | createRelativeURL(URL url, URL baseURL) Creates a relative url by stripping the common parts of the the url.
Parameters: url - the to be stripped url Parameters: baseURL - the base url, to which the url is relative to. | public String | getFileExtension(String file) Returns the file extension of the given file name.
The returned value will contain the dot.
Parameters: file - the file name. | public String | getFileName(URL url) Extracts the file name from the URL.
Parameters: url - the url. | public static IOUtils | getInstance() Gets the singleton instance of the utility package. | public boolean | isSubDirectory(File base, File child) Checks, whether the child directory is a subdirectory of the base
directory.
Parameters: base - the base directory. Parameters: child - the suspected child directory. | public String | stripFileExtension(String file) Removes the file extension from the given file name.
Parameters: file - the file name. |
copyStreams | public void copyStreams(InputStream in, OutputStream out) throws IOException(Code) | | Copies the InputStream into the OutputStream, until the end of the stream
has been reached. This method uses a buffer of 4096 kbyte.
Parameters: in - the inputstream from which to read. Parameters: out - the outputstream where the data is written to. throws: IOException - if a IOError occurs. |
copyStreams | public void copyStreams(InputStream in, OutputStream out, int buffersize) throws IOException(Code) | | Copies the InputStream into the OutputStream, until the end of the stream
has been reached.
Parameters: in - the inputstream from which to read. Parameters: out - the outputstream where the data is written to. Parameters: buffersize - the buffer size. throws: IOException - if a IOError occurs. |
copyWriter | public void copyWriter(Reader in, Writer out) throws IOException(Code) | | Copies the contents of the Reader into the Writer, until the end of the
stream has been reached. This method uses a buffer of 4096 kbyte.
Parameters: in - the reader from which to read. Parameters: out - the writer where the data is written to. throws: IOException - if a IOError occurs. |
copyWriter | public void copyWriter(Reader in, Writer out, int buffersize) throws IOException(Code) | | Copies the contents of the Reader into the Writer, until the end of the
stream has been reached.
Parameters: in - the reader from which to read. Parameters: out - the writer where the data is written to. Parameters: buffersize - the buffer size. throws: IOException - if a IOError occurs. |
createRelativeURL | public String createRelativeURL(URL url, URL baseURL)(Code) | | Creates a relative url by stripping the common parts of the the url.
Parameters: url - the to be stripped url Parameters: baseURL - the base url, to which the url is relative to. the relative url, or the url unchanged, if there is no relationbeween both URLs. |
getFileExtension | public String getFileExtension(String file)(Code) | | Returns the file extension of the given file name.
The returned value will contain the dot.
Parameters: file - the file name. the file extension. |
getFileName | public String getFileName(URL url)(Code) | | Extracts the file name from the URL.
Parameters: url - the url. the extracted filename. |
getInstance | public static IOUtils getInstance()(Code) | | Gets the singleton instance of the utility package.
the singleton instance. |
isSubDirectory | public boolean isSubDirectory(File base, File child) throws IOException(Code) | | Checks, whether the child directory is a subdirectory of the base
directory.
Parameters: base - the base directory. Parameters: child - the suspected child directory. true, if the child is a subdirectory of the base directory. throws: IOException - if an IOError occured during the test. |
stripFileExtension | public String stripFileExtension(String file)(Code) | | Removes the file extension from the given file name.
Parameters: file - the file name. the file name without the file extension. |
|
|