/** * auxiliary method that returns true if mask is needed and deletes all delegates * on writable layers if deleteDelegates is true. * @param lock * @param deleteDelegates if true all delegates on writable layers will be deleted * @throws IOException is thrown if lock is not valid. * @return true if mask is necessary*/ private boolean needsMask(FileLock lock, boolean deleteDelegates) throws IOException { MfLock lck = testLock(lock); Enumeration<FileObject> e = getMultiFileSystem().delegates(getPath()); boolean needsMask = false; while (e.hasMoreElements()) { FileObject fo = e.nextElement(); FileLock lockForFo = lck.findLock(fo); if (lockForFo == null) { // we will need to create mask needsMask = true; } else { if (deleteDelegates) { fo.delete(lockForFo); } } } return needsMask; }
leader.rename(l.findLock(leader), name, ext); getMultiFileSystem().unmaskFileOnAll(single, newFullName); copyContent(this, leader);
leader.rename (l.findLock (leader), name, ext); getMultiFileSystem ().unmaskFileOnAll (single, newFullName); copyContent (this,leader);
leader.rename (l.findLock (leader), name, ext); getMultiFileSystem ().unmaskFileOnAll (single, newFullName); copyContent (this,leader);
/** * auxiliary method that returns true if mask is needed and deletes all delegates * on writable layers if deleteDelegates is true. * @param lock * @param deleteDelegates if true all delegates on writable layers will be deleted * @throws IOException is thrown if lock is not valid. * @return true if mask is necessary*/ private boolean needsMask(FileLock lock, boolean deleteDelegates) throws IOException{ MfLock lck = testLock(lock); Enumeration e = getMultiFileSystem().delegates(getPath()); boolean needsMask = false; while (e.hasMoreElements()) { FileObject fo = (FileObject) e.nextElement(); FileLock lockForFo = lck.findLock(fo); if (lockForFo == null) { // we will need to create mask needsMask = true; } else { if (deleteDelegates) fo.delete(lockForFo); } } return needsMask; }
/** * auxiliary method that returns true if mask is needed and deletes all delegates * on writable layers if deleteDelegates is true. * @param lock * @param deleteDelegates if true all delegates on writable layers will be deleted * @throws IOException is thrown if lock is not valid. * @return true if mask is necessary*/ private boolean needsMask(FileLock lock, boolean deleteDelegates) throws IOException{ MfLock lck = testLock(lock); Enumeration e = getMultiFileSystem().delegates(getPath()); boolean needsMask = false; while (e.hasMoreElements()) { FileObject fo = (FileObject) e.nextElement(); FileLock lockForFo = lck.findLock(fo); if (lockForFo == null) { // we will need to create mask needsMask = true; } else { if (deleteDelegates) fo.delete(lockForFo); } } return needsMask; }
public OutputStream getOutputStream (FileLock lock) throws java.io.IOException { MfLock l; FileLock lWritable; FileObject fo; try { getFileSystem ().beginAtomicAction (markAtomicAction); synchronized (this) { l = testLock (lock); // this can also change lock in l.lock fo = writable (); lWritable = l.findLock (fo); } return fo.getOutputStream (lWritable); } finally { getFileSystem ().finishAtomicAction (); } }
public OutputStream getOutputStream (FileLock lock) throws java.io.IOException { MfLock l; FileLock lWritable; FileObject fo; try { getFileSystem ().beginAtomicAction (markAtomicAction); synchronized (this) { l = testLock (lock); // this can also change lock in l.lock fo = writable (); lWritable = l.findLock (fo); } return fo.getOutputStream (lWritable); } finally { getFileSystem ().finishAtomicAction (); } }
public OutputStream getOutputStream(FileLock lock) throws java.io.IOException { MfLock l; FileLock lWritable; FileObject fo; try { getFileSystem().beginAtomicAction(markAtomicAction); synchronized (this) { l = testLock(lock); // this can also change lock in l.lock fo = writable(false); lWritable = l.findLock(fo); } return fo.getOutputStream(lWritable); } finally { getFileSystem().finishAtomicAction(); } }