All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.giraone.io.copier.resource.DirectReadFromUrlStreamProvider Maven / Gradle / Ivy

Go to download

Utility JAR for copying a file tree from web server or from classpath resources to a (local) file system.

The newest version!
package com.giraone.io.copier.resource;

import com.giraone.io.copier.ReadFromUrlStreamProvider;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

/**
 * The default implementation for reading content from a URL.
 * This is simply {@link URL#openStream()}.
 */
public class DirectReadFromUrlStreamProvider implements ReadFromUrlStreamProvider {

    @Override
    public InputStream openInputStream(URL url) {

        try {
            return url.openStream();
        } catch (IOException e) {
            throw new RuntimeException("Cannot open URL \"" + url + "\"", e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy