public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/10403: FileInputStream(File.toUrl().getFile()) does not work
@ 2003-04-14 19:36 marilen.corciovei
  0 siblings, 0 replies; only message in thread
From: marilen.corciovei @ 2003-04-14 19:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10403
>Category:       libgcj
>Synopsis:       FileInputStream(File.toUrl().getFile()) does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 14 19:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Marilen Corciovei
>Release:        3.3 cvs
>Organization:
>Environment:
windows 2000, mingw
>Description:
The following code throws a FileNotFoundException even if the file is valid.

File file = new File(args[0]);
URL url;
if (file.exists()) {
     url = file.toURL();
}else{
     url = new URL(args[0]);
}
String fileName = url.getFile();
FileInputStream f = new FileInputStream(fileName);

File.toUrl() returns something like:
"file:/c:/thisiscool-gcc/examples/reflect/src/list" (java.io.File#779)
which is parsed at java.net.URL#331 after that the URL.getFile will return "/c:/thisiscool-gcc/examples/reflect/src/list". From this point all the problems begin.
- the exception is thrown probably in the native FileDescriptor: natFileDescriptorWin32.cc#116 implementations

The problem is probably in the FileInputStream implementation
>How-To-Repeat:
Compile the code using gcj --Main=main -o test.exe Main.java and run ./test.exe
>Fix:

The problem is probably in the FileInputStream implementation since the URL.toFile returns what it is expected.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-14 19:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-14 19:36 libgcj/10403: FileInputStream(File.toUrl().getFile()) does not work marilen.corciovei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).