Commit 88f2e103 by Guilhem Lavaux Committed by Michael Koch

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.

From-SVN: r75039
parent 06fc4e41
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):
......
......@@ -79,11 +79,7 @@ public class FileInputStream extends InputStream
*/
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));
}
/**
......@@ -104,7 +100,14 @@ public class FileInputStream extends InputStream
*/
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);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment