src/share/classes/java/io/FileOutputStream.java

Print this page
rev 9260 : imported patch io-events-path

*** 65,74 **** --- 65,79 ---- /** * The associated channel, initialized lazily. */ private FileChannel channel; + /** + * The path of the referenced file (null if the stream is created with a file descriptor) + */ + private final String path; + private final Object closeLock = new Object(); private volatile boolean closed = false; /** * Creates a file output stream to write to the file with the
*** 200,209 **** --- 205,215 ---- throw new FileNotFoundException("Invalid file path"); } this.fd = new FileDescriptor(); fd.attach(this); this.append = append; + this.path = name; open(name, append); } /**
*** 237,246 **** --- 243,253 ---- if (security != null) { security.checkWrite(fdObj); } this.fd = fdObj; this.append = false; + this.path = null; fd.attach(this); } /**
*** 374,384 **** * @spec JSR-51 */ public FileChannel getChannel() { synchronized (this) { if (channel == null) { ! channel = FileChannelImpl.open(fd, false, true, append, this); } return channel; } } --- 381,391 ---- * @spec JSR-51 */ public FileChannel getChannel() { synchronized (this) { if (channel == null) { ! channel = FileChannelImpl.open(fd, path, false, true, append, this); } return channel; } }