* java/io/FileInputStream.java
(FileInputStream(String)): Call FileInputStream(File).
(FileInputStream(File)): Check whether the argument is a directory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75039
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/FileInputStream.java
+ (FileInputStream(String)): Call FileInputStream(File).
+ (FileInputStream(File)): Check whether the argument is a directory.
+
2003-12-26 Michael Koch <konqueror@gmx.de>
* Makefile.am (rmi_java_source_files):
*/
public FileInputStream(String name) throws FileNotFoundException
{
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkRead(name);
-
- fd = new FileDescriptor(name, FileDescriptor.READ);
+ this(new File(name));
}
/**
*/
public FileInputStream(File file) throws FileNotFoundException
{
- this(file.getPath());
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkRead(file.getPath());
+
+ if (file.isDirectory())
+ throw new FileNotFoundException(file.getPath() + " is a directory");
+
+ fd = new FileDescriptor(file.getPath(), FileDescriptor.READ);
}
/**