private void deleteFile(String name) throws IOException { OutputStream os = null; this.info.lock(name); try { //added because of mutual exclusion of streams (waits a while until stream is closed) os = this.info.outputStream(name); os.close(); os = null; this.change.delete(name); } finally { if (os != null) { os.close(); } this.info.unlock(name); } }
public synchronized FileLock lock() throws IOException { if (lock != null) { FileLock f = lock.get(); if (f != null) { // System.out.println ("Already locked: " + this); // NOI18N throw new FileAlreadyLockedException(); } } getAbstractFileSystem().info.lock(getPath()); FileLock l = new AfLock(); lock = new WeakReference<FileLock>(l); // Thread.dumpStack (); // System.out.println ("Locking file: " + this); // NOI18N return l; }
public synchronized FileLock lock () throws IOException { if (lock != null) { FileLock f = (FileLock)lock.get (); if (f != null) { // System.out.println ("Already locked: " + this); // NOI18N throw new FileAlreadyLockedException(); } } getAbstractFileSystem ().info.lock (getPath ()); FileLock l = new AfLock (); lock = new WeakReference (l); // Thread.dumpStack (); // System.out.println ("Locking file: " + this); // NOI18N return l; }
public synchronized FileLock lock () throws IOException { if (lock != null) { FileLock f = (FileLock)lock.get (); if (f != null) { // System.out.println ("Already locked: " + this); // NOI18N throw new FileAlreadyLockedException(); } } getAbstractFileSystem ().info.lock (getPath ()); FileLock l = new AfLock (); lock = new WeakReference (l); // Thread.dumpStack (); // System.out.println ("Locking file: " + this); // NOI18N return l; }