From b4ac09cddb5a433147b996570258e8732a706a18 Mon Sep 17 00:00:00 2001 From: bryce Date: Sun, 30 Sep 2001 07:52:16 +0000 Subject: PR libgcj/4383 * gnu/gcj/protocol/file/Connection.java (connect): Throw FileNotFoundException if appropriate. * gnu/gcj/protocol/file/Handler.java (openConnection): Throw an IOException if we got a file: url with a hostname. Comment out protocol switch to ftp for now. * java/net/URL.java (URL): Include protocol name in exception message when handler can't be found. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45898 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/gcj/protocol/file/Connection.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libjava/gnu/gcj/protocol/file/Connection.java') diff --git a/libjava/gnu/gcj/protocol/file/Connection.java b/libjava/gnu/gcj/protocol/file/Connection.java index b7804cbea0c..e9ef08f2c30 100644 --- a/libjava/gnu/gcj/protocol/file/Connection.java +++ b/libjava/gnu/gcj/protocol/file/Connection.java @@ -48,7 +48,11 @@ class Connection extends URLConnection // If not connected, then file needs to be openned. fileIn = new File(url.getFile()); - connected = true; + + if (fileIn.exists()) + connected = true; + else + throw new FileNotFoundException("No such file or directory"); } public InputStream getInputStream() throws IOException -- cgit v1.2.3