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
This commit is contained in:
parent
06fc4e4186
commit
88f2e10376
@ -1,3 +1,9 @@
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user