Java Code Examples for org.jfree.io.IOUtils

The following examples show how to use org.jfree.io.IOUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Sets the parameters of this description object to match the supplied object.
 *
 * @param o  the object (should be an instance of <code>URL</code>).
 *
 * @throws ObjectFactoryException if the object is not an instance of <code>URL</code>.
 */
public void setParameterFromObject(final Object o) throws ObjectFactoryException {
    if (!(o instanceof URL)) {
        throw new ObjectFactoryException("Is no instance of java.net.URL");
    }

    final URL comp = (URL) o;
    final String baseURL = getConfig().getConfigProperty(Parser.CONTENTBASE_KEY);
    try {
        final URL bURL = new URL(baseURL);
        setParameter("value", IOUtils.getInstance().createRelativeURL(comp, bURL));
    }
    catch (Exception e) {
        Log.warn("BaseURL is invalid: ", e);
    }
    setParameter("value", comp.toExternalForm());
}
 
Example 2
/**
 * Starts include handling.
 * 
 * @param resource  the URL.
 */
protected void startIncludeHandling(final URL resource) {
    this.source = IOUtils.getInstance().createRelativeURL(resource, this.baseURL);
    this.model.addSource(this.source);
    this.model.addIncludeComment(
        this.source, new Comments(getOpenComment(), getCloseComment())
    );
}
 
Example 3
Source Project: uyuni   Source File: DownloadUtils.java    License: GNU General Public License v2.0 4 votes vote down vote up
private static String toString(InputStream stream) throws IOException {
    StringWriter writer = new StringWriter();
    IOUtils.getInstance().copyWriter(
            new BufferedReader(new InputStreamReader(stream)), writer);
    return writer.toString();
}
 
Example 4
Source Project: spacewalk   Source File: DownloadUtils.java    License: GNU General Public License v2.0 4 votes vote down vote up
private static String toString(InputStream stream) throws IOException {
    StringWriter writer = new StringWriter();
    IOUtils.getInstance().copyWriter(
            new BufferedReader(new InputStreamReader(stream)), writer);
    return writer.toString();
}