You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2009/06/26 15:41:07 UTC

[jira] Closed: (HARMONY-5737) [classlib][luni]FileURLConnection.connect fails in presence of anchor's

     [ https://issues.apache.org/jira/browse/HARMONY-5737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison closed HARMONY-5737.
--------------------------------


Verified by dims

> [classlib][luni]FileURLConnection.connect fails in presence of anchor's
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-5737
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5737
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Davanum Srinivas
>            Assignee: Tony Wu
>             Fix For: 5.0M6
>
>         Attachments: Harmony-5737-V2.diff, Harmony-5737.diff
>
>
> Download the following html to your local directory
> curl -O http://www.apache.org/foundation/how-it-works.html
> and run this Test case.
> ========================
> import java.net.*;
> import java.io.*;
> public class Main {
>     public static void main(String[] args) throws Exception {
>         File f = new File("how-it-works.html");
>         URL anchor = new URL(f.toURL(), "#meritocracy");
>         System.out.println("Anchor : " + anchor);
>         URLConnection connection = anchor.openConnection();
>         DataInputStream dis = new DataInputStream(connection.getInputStream());
>         String inputLine;
>         while ((inputLine = dis.readLine()) != null) {
>             System.out.println(inputLine);
>         }
>         dis.close();
>     }
> }
> ========================
> Here's the stack trace :
> [dims@dims-desktop sample]$../jdk/bin/java -cp . Main
> Anchor : file:/home/dims/harmony/target/hdk/sample/how-it-works.html#meritocracy
> Uncaught exception in main:
> java.io.FileNotFoundException: /home/dims/harmony/target/hdk/sample/how-it-works.html#meritocracy
>         at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:235)
>         at java.io.FileInputStream.<init>(FileInputStream.java:76)
>         at org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:91)
>         at org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:189)
>         at Main.main(Main.java:10)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.