Index: FileEntry.java =================================================================== RCS file: /cvs/openide/src/org/openide/loaders/FileEntry.java,v retrieving revision 1.19 diff -c -r1.19 FileEntry.java *** FileEntry.java 2000/10/16 16:18:00 1.19 --- FileEntry.java 2001/04/04 07:27:07 *************** *** 52,62 **** * @return file object with renamed file */ public FileObject rename (String name) throws IOException { FileLock lock = takeLock(); try { getFile().rename(lock, name, getFile().getExt()); } finally { ! lock.releaseLock(); } return getFile (); } --- 52,66 ---- * @return file object with renamed file */ public FileObject rename (String name) throws IOException { + boolean locked = isLocked (); + FileLock lock = takeLock(); try { getFile().rename(lock, name, getFile().getExt()); } finally { ! if (!locked) { ! lock.releaseLock(); ! } } return getFile (); } *************** *** 67,72 **** --- 71,78 ---- * @return new file object for the file */ public FileObject move (FileObject f, String suffix) throws IOException { + boolean locked = isLocked (); + FileObject fo = getFile(); FileLock lock = takeLock (); try { *************** *** 74,80 **** FileObject dest = fo.move (lock, f, newName, fo.getExt ()); return dest; } finally { ! lock.releaseLock (); } } --- 80,88 ---- FileObject dest = fo.move (lock, f, newName, fo.getExt ()); return dest; } finally { ! if (locked) { ! lock.releaseLock (); ! } } } *************** *** 87,99 **** if (isLocked()) throw new IOException(NbBundle.getBundle (FileEntry.class).getString ("EXC_SharedAccess")); */ FileLock lock = takeLock(); try { getFile().delete(lock); } finally { ! lock.releaseLock(); } } --- 95,111 ---- if (isLocked()) throw new IOException(NbBundle.getBundle (FileEntry.class).getString ("EXC_SharedAccess")); */ + + boolean locked = isLocked (); FileLock lock = takeLock(); try { getFile().delete(lock); } finally { ! if (locked) { ! lock.releaseLock(); ! } } }