Package org.openide.filesystems

Examples of org.openide.filesystems.FileObject.lock()


        fo.delete();
    }

    private void rename ( String path, String newName ) throws IOException {
        FileObject fo = mfs.getRoot().getFileObject( path );
        FileLock lock = fo.lock();
        try {
            fo.rename( lock, newName, "txt" );
        } finally {
            lock.releaseLock();
        }
View Full Code Here


                //Delete original file
                fileObject.delete();

                //Rename
                FileObject tempFileObject = FileUtil.toFileObject(writeFile);
                FileLock lock = tempFileObject.lock();
                tempFileObject.rename(lock, name, ext);
                lock.releaseLock();
            }

        } catch (Exception ex) {
View Full Code Here

            throw new IllegalStateException("No Merge engine found."); // NOI18N
        }

        try {
            FileObject fo = FileUtil.toFileObject(file);
            handleMergeFor(file, fo, fo.lock(), merge);
        } catch (FileAlreadyLockedException e) {
            Set<TopComponent> components = TopComponent.getRegistry().getOpened();
            for (TopComponent tc : components) {
                if (tc.getClientProperty(ResolveConflictsExecutor.class.getName()) != null) {
                    tc.requestActive();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.