Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-831

Add getInputStream() for 'https' & 'http' in URIOrigin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.0
    • None
    • None

    Description

      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)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elharo Elliotte Rusty Harold
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: