Elliotte Rusty Harold created IO-831:
----------------------------------------

             Summary: http URI origins don't work
                 Key: IO-831
                 URL: https://issues.apache.org/jira/browse/IO-831
             Project: Commons IO
          Issue Type: Bug
            Reporter: Elliotte Rusty Harold


I think file URLs might work but http/https URLs, much more common, don't. I'm 
not yet sure if this can be fixed without changing the API.

    @Test
    public void testReadFromURL() throws URISyntaxException, IOException {
        final URIOrigin origin = new URIOrigin(new 
URI("https://www.yahoo.com";));
        try (final InputStream in = origin.getInputStream()) {
            assertNotEquals(-1, in.read());
        }
    }

java.nio.file.FileSystemNotFoundException: Provider "https" not installed
        at java.nio.file.Paths.get(Paths.java:147)
        at 
org.apache.commons.io.build.AbstractOrigin$URIOrigin.getPath(AbstractOrigin.java:402)
        at 
org.apache.commons.io.build.AbstractOrigin.getInputStream(AbstractOrigin.java:540)
        at 
org.apache.commons.io.build.URIOriginTest.testReadFromURL(URIOriginTest.java:47)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at java.util.ArrayList.forEach(ArrayList.java:1257)





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to