summaryrefslogtreecommitdiff
path: root/java/io/RandomAccessFile.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/io/RandomAccessFile.java')
-rw-r--r--java/io/RandomAccessFile.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/java/io/RandomAccessFile.java b/java/io/RandomAccessFile.java
index d719a1e3b..036fc8c6b 100644
--- a/java/io/RandomAccessFile.java
+++ b/java/io/RandomAccessFile.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.io;
-import gnu.java.nio.channels.FileChannelImpl;
+import gnu.java.nio.FileChannelImpl;
import java.nio.channels.FileChannel;
@@ -122,7 +122,20 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable
s.checkWrite(fileName);
}
- ch = FileChannelImpl.create(file, fdmode);
+ try
+ {
+ ch = FileChannelImpl.create(file, fdmode);
+ }
+ catch (FileNotFoundException fnfe)
+ {
+ throw fnfe;
+ }
+ catch (IOException ioe)
+ {
+ FileNotFoundException fnfe = new FileNotFoundException(file.getPath());
+ fnfe.initCause(ioe);
+ throw fnfe;
+ }
fd = new FileDescriptor(ch);
if ((fdmode & FileChannelImpl.WRITE) != 0)
out = new DataOutputStream (new FileOutputStream (fd));