summaryrefslogtreecommitdiff
path: root/java/io/FileOutputStream.java
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2002-11-29 18:41:03 +0000
committerMark Wielaard <mark@klomp.org>2002-11-29 18:41:03 +0000
commit7d754e43f0120964d1d329cac79393eb5acd056f (patch)
treec6f096b1eee5d8183c45d8264da00bb25609d36f /java/io/FileOutputStream.java
parent206bdb02165b314d8e5addf878b34c20f8604a78 (diff)
downloadclasspath-7d754e43f0120964d1d329cac79393eb5acd056f.tar.gz
Merge patches from Julian Dolby <dolby@us.ibm.com>
* java/io/File.java (File(File, String)): Only add separator when dirpath is not a root dir. (File(String, String)): Call this(File, String). (File(String)): Remove all trailing separators when not root dir. (canWrite): Return null when no separator is found in path. If a directory then check that we can create and delete temp file. (list): Return null when file not exists or is not a dir. Return empty array when listInternal returns null. * java/io/FileInputStream.java(open): Throws FileNotFoundException. * java/io/FileOutputStream.java (FileOutputStream): Likewise. (open): Likewise. * native/jni/java-io/java_io_FileOutputStream.c (open): Likewise. * native/jni/java-io/javaio.c (_javaio_close): Check that fd != -1. * THANKYOU: Add Julian Dolby.
Diffstat (limited to 'java/io/FileOutputStream.java')
-rw-r--r--java/io/FileOutputStream.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/java/io/FileOutputStream.java b/java/io/FileOutputStream.java
index 9f14c049e..50ee24022 100644
--- a/java/io/FileOutputStream.java
+++ b/java/io/FileOutputStream.java
@@ -97,10 +97,10 @@ private int native_fd = -1;
* @param name The name of the file this stream should write to
*
* @exception SecurityException If write access to the file is not allowed
- * @exception IOException If a non-security error occurs
+ * @exception FileNotFoundException If a non-security error occurs
*/
public
-FileOutputStream(String name) throws SecurityException, IOException
+FileOutputStream(String name) throws SecurityException, FileNotFoundException
{
this(name, false);
}
@@ -121,10 +121,10 @@ FileOutputStream(String name) throws SecurityException, IOException
* @param file The <code>File</code> object this stream should write to
*
* @exception SecurityException If write access to the file is not allowed
- * @exception IOException If a non-security error occurs
+ * @exception FileNotFoundException If a non-security error occurs
*/
public
-FileOutputStream(File file) throws SecurityException, IOException
+FileOutputStream(File file) throws SecurityException, FileNotFoundException
{
this(file.getPath(), false);
}
@@ -144,14 +144,15 @@ FileOutputStream(File file) throws SecurityException, IOException
* thrown if writing is not allowed.
*
* @param name The name of the file this stream should write to
- * @param append <code>true</code> to append bytes to the end of the file, or <code>false</code> to write bytes to the beginning
+ * @param append <code>true</code> to append bytes to the end of the file,
+ * or <code>false</code> to write bytes to the beginning
*
* @exception SecurityException If write access to the file is not allowed
- * @exception IOException If a non-security error occurs
+ * @exception FileNotFoundException If a non-security error occurs
*/
public
FileOutputStream(String name, boolean append) throws SecurityException,
- IOException
+ FileNotFoundException
{
SecurityManager sm = System.getSecurityManager();
if (sm != null)
@@ -304,14 +305,15 @@ writeInternal(int native_fd, byte[] buf, int offset, int len) throws IOException
* beginning.
*
* @param name The name of the file to open
- * @param append <code>true</code> to write starting at the end of the file, <code>false</code> to start writing at the beginning
+ * @param append <code>true</code> to write starting at the end of the file,
+ * <code>false</code> to start writing at the beginning
*
* @return A native file descriptor for this file
*
- * @exception IOException If an error occurs
+ * @exception FileNotFoundException If an error occurs
*/
private synchronized native int
-open(String name, boolean append) throws IOException;
+open(String name, boolean append) throws FileNotFoundException;
/*************************************************************************/