harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Wu (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5737) [classlib][luni]FileURLConnection.connect fails in presence of anchor's
Date Wed, 16 Apr 2008 14:31:21 GMT

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

Tony Wu updated HARMONY-5737:
-----------------------------

    Summary: [classlib][luni]FileURLConnection.connect fails in presence of anchor's  (was:
FileURLConnection.connect fails in presence of anchor's)

add prefix.

> [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
>         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.


Mime
View raw message