src/share/classes/java/io/RandomAccessFile.java
Print this page
rev 9260 : [mq]: io-events-path
*** 60,69 ****
--- 60,75 ----
private FileDescriptor fd;
private FileChannel channel = null;
private boolean rw;
+ /**
+ * The path of the referenced file
+ * (null if the stream is created with a file descriptor)
+ */
+ private final String path;
+
private Object closeLock = new Object();
private volatile boolean closed = false;
private static final int O_RDONLY = 1;
private static final int O_RDWR = 2;
*** 231,240 ****
--- 237,247 ----
if (file.isInvalid()) {
throw new FileNotFoundException("Invalid file path");
}
fd = new FileDescriptor();
fd.attach(this);
+ path = name;
open(name, imode);
}
/**
* Returns the opaque file descriptor object associated with this
*** 270,280 ****
* @spec JSR-51
*/
public final FileChannel getChannel() {
synchronized (this) {
if (channel == null) {
! channel = FileChannelImpl.open(fd, true, rw, this);
}
return channel;
}
}
--- 277,287 ----
* @spec JSR-51
*/
public final FileChannel getChannel() {
synchronized (this) {
if (channel == null) {
! channel = FileChannelImpl.open(fd, path, true, rw, this);
}
return channel;
}
}