summaryrefslogtreecommitdiff
path: root/libjava/gnu/gcj/protocol/file/Connection.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu/gcj/protocol/file/Connection.java')
-rw-r--r--libjava/gnu/gcj/protocol/file/Connection.java6
1 files changed, 5 insertions, 1 deletions
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