This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
<apidef name="filesystems">Filesystems API</apidef>
</apidefs>
<changes>
<change id="added-FileObject-getOutputStream-without-FileLock-parameter">
<api name="filesystems"/>
<summary>Added additional method <code>FileObject.getOutpuStream</code>
that doesn't take <code>FileLock</code> as a parameter.
</summary>
<version major="6" minor="6"/>
<date day="3" month="5" year="2006"/>
<author login="rmatous"/>
<compatibility addition="yes" binary="compatible" source="compatible" semantic="compatible" deprecation="no" deletion="no" modification="no"/>
<description>
<p>
Although newly added method <code>FileObject.getOutpuStream</code>
doesn't take <code>FileLock</code> as a parameter, the implementation
is responsible for taking a lock before <code>OutputStream</code> is
returned and thus <code>FileAlreadyLockedException</code> exception is thrown
when <code>FileObject</code> is already locked.
</p>
</description>
<class package="org.openide.filesystems" name="FileObject"/>
</change>
<change id="semantic-change-in-FileUtil.toFileObject">
<summary>
Manifest-Version: 1.0
OpenIDE-Module: org.openide.filesystems
OpenIDE-Module-Specification-Version: 6.5
OpenIDE-Module-Specification-Version: 6.6
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
*/
public abstract OutputStream getOutputStream(FileLock lock)
throws IOException;
/** Get output stream.
* @return output stream to overwrite the contents of this file
* @throws IOException if an error occures (the file is invalid, etc.)
* @throws FileAlreadyLockedException if the file is already locked
public final OutputStream getOutputStream() throws FileAlreadyLockedException, IOException {
final FileLock lock = lock();
final OutputStream os = getOutputStream(lock);
return new FilterOutputStream(os) {
public void close() throws IOException {
try {
super.close();
lock.releaseLock();
} catch(IOException iex) {
if (lock.isValid()) {
}
throw iex;
};
/** Lock this file.
* @return lock that can be used to perform various modifications on the file