alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 *
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 *
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.modules.vcscore.caching;

import java.awt.Image;
import java.lang.ref.*;
import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.openide.NotifyDescriptor;
import org.openide.util.NbBundle;
import org.openide.util.WeakListener;

import org.netbeans.api.vcs.FileStatusInfo;

import org.netbeans.modules.vcscore.VcsFileSystem;
import org.netbeans.modules.vcscore.cache.*;
import org.netbeans.modules.vcscore.settings.GeneralVcsSettings;
import org.netbeans.modules.vcscore.util.VcsUtilities;
import org.openide.DialogDisplayer;

/**
 * This class creates and registeres cache for VCS filesystem.
 * It creates one VcsCache object for each filesystem, therefore each filesystem should provide
 * different cache ID.
 *
 * @author  Martin Entlicher
 */
public final class VcsFSCache extends Object implements FileStatusProvider, FileCacheProvider {
        
    public final String localStatusStr = g("CTL_StatusLocal"); // NOI18N
    public final String ignoredStatusStr = g("CTL_StatusIgnored"); // NOI18N
    //private final String modifiedStatus = g("CTL_DefaultModifiedStatus"); // NOI18N
    //private final String deadStatus = g("CTL_StatusDead"); // NOI18N
    //private final String notInSynchStatus = g("CTL_StatusNotInSync"); // NOI18N
    //private final String unknownStatus = g("CTL_StatusUnknown"); // NOI18N
    //private HashMap fileStatuses = new HashMap();

    //private boolean localFilesAdd = true;

    private WeakReference fileSystem;
    private CacheHandler handler;
    private String cacheId;
    private String fsRoot;
    private String relativeMountPoint;

    /** Creates new VcsFSCache */
    public VcsFSCache(VcsFileSystem fileSystem) {
        this.fileSystem = new WeakReference(fileSystem);
        cacheId = fileSystem.getCacheIdStr();
        fsRoot = fileSystem.getFSRoot();
        relativeMountPoint = fileSystem.getRelativeMountPoint();
        handler = CacheHandler.getInstance();
        //initFileStatuses();
        VcsCache cacheObj = new VcsCache(this.fileSystem, getCacheId());
        handler.registerCacheType(getCacheId(), cacheObj);
        cacheObj.addCacheHandlerListener((CacheHandlerListener) WeakListener.create(CacheHandlerListener.class, fileSystem, cacheObj));
    }

    /* FileStatusProvider */

    /*
    private void initFileStatuses() {
        fileStatuses.put(localStatusStr, localStatusStr);
        fileStatuses.put(modifiedStatus, modifiedStatus);
        //fileStatuses.put(missingStatus, missingStatus);
        fileStatuses.put(VcsCacheFile.STATUS_DEAD, deadStatus);
        fileStatuses.put(notInSynchStatus, notInSynchStatus);
        fileStatuses.put(unknownStatus, unknownStatus);
        fileStatuses.put(VcsCacheFile.STATUS_IGNORED, ignoredStatusStr);
    }
     */
    
    /**
     * Get the set of all possible FileStatusInfo objects.
     */
    public Set getPossibleFileStatusInfos() {
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        if (fs != null) {
            Set fss = fs.getPossibleFileStatusInfos();
            if (fss == null || fss.size() == 0) return CacheFileStatusInfo.createDefaultPossibleFileStatusInfos();
            else return fss;
        } else {
            return CacheFileStatusInfo.createDefaultPossibleFileStatusInfos();
        }
    }
    
    /*
    public HashMap getPossibleFileStatusesTable() {
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        if (fs != null) {
            HashMap fst = fs.getPossibleFileStatusesTable();
            if (fst == null) return new HashMap(fileStatuses);
            else return fst;
        } else {
            return new HashMap();
        }
    }
    
    public HashMap getStatusIconMap() {
        HashMap iconStatusMap = new HashMap();
        iconStatusMap.put(modifiedStatus, org.openide.util.Utilities.loadImage("org/netbeans/modules/vcscore/caching/badgeLocModified.gif"));
        return iconStatusMap;
        //return new HashMap();
    }
     */

    /**
     * Get the status that is displayed instead of the attribute value, when this
     * value differs for multiple files contained in the same data object file.
     */
    public String getNotInSynchStatus() {
        return NbBundle.getMessage(VcsFSCache.class, "CTL_StatusNotInSync");
    }
    
    /**
     * Set the file as modified. The status of the file will be changed
     * to the [Locally Modified]
     */ // if not set otherwise by {@link setStatusString()}
    public void setFileModified(String path) {
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        String status = FileStatusInfo.MODIFIED.getName();
        if (fs != null) {
            Map tranls = fs.getGenericStatusTranslation();
            if (tranls != null) {
                status = (String) tranls.get(status);
                if (status == null) {
                    // There's no mapping, use the generic status name!
                    status = FileStatusInfo.MODIFIED.getName();
                }
            }
        }
        setFileStatus(path, status);
    }
    
    /* TODO: in the future one may need to modify the modifiedStatus
    public void setStatusStringModified(String status) {
        modifiedStatus = replaceStatus(modifiedStatus, status);
    }
    
    public void setStatusStringMissing(String status) {
        System.out.println("setStatusStringMissing("+status+")");
        missingStatus = replaceStatus(missingStatus, status);
        System.out.println("  => new missing status = '"+missingStatus+"'");
    }
    
    private String replaceStatus(String modifiedStatus, String status) {
        fileStatuses.remove(modifiedStatus);
        fileStatuses.put(status, status);
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        HashMap fst = null;
        String newModified = null;
        if (fs != null) {
            fst = fs.getPossibleFileStatusesTable();
            if (fst != null) {
                fst.remove(modifiedStatus);
                if (!fst.containsKey(status)) {
                    fst.put(status, status);
                } else newModified = (String) fst.get(status);
            }
        }
        if (newModified == null) newModified = status;
        return newModified;
    }
     */
    
    public String getLocalFileStatus() {
        return localStatusStr;
    }
    
    public void setFileStatus(String path, String status) {
        CacheFile file = getFileOrDir(path, null);
        //System.out.println("setFileStatus("+path+", "+status+": file = '"+file+"'");
        if (file != null && !status.equals(file.getStatus())) {
            file.setStatus(status);
            file.getParent().writeToDisk();
            FileSystemCache cache = handler.getCache(getCacheId());
            cache.fireCacheHandlerEvent(FileSystemCache.EVENT_CHANGED, file);
        }
    }
    
    /**
     * Set the status of files, if they exist in the cache and their last status
     * is not contained in a specified collection.
     * @param folderPath the folder of files
     * @param fileNames the list of file names
     * @param status the status to set
     * @param notModifiableStates the collection of statuses, that will not be changed
     *        or null if any status can be changed
     * @param fireChange whether the change should be fired.
     * @return the set of changed cache files
     */
    public Set setExistingFileStatus(String folderPath, String[] fileNames, String status,
                                     Collection notModifiableStates, boolean fireChange) {
        CacheDir dir = getDir(folderPath);
        if (dir != null) {
            HashSet changedFiles = new HashSet();
            for (int i = 0; i < fileNames.length; i++) {
                CacheFile file = dir.getFile(fileNames[i]);
                if (file == null) file = dir.getSubDir(fileNames[i]);
                if (file != null) {
                    String oldStatus = file.getStatus();
                    if (notModifiableStates == null || !notModifiableStates.contains(oldStatus)) {
                        if (!status.equals(oldStatus)) {
                            file.setStatus(status);
                            changedFiles.add(file);
                        }
                    }
                }
            }
            if (changedFiles.size() > 0) {
                dir.writeToDisk();
                if (fireChange) {
                    FileSystemCache cache = handler.getCache(getCacheId());
                    try {
                    cache.fireCacheHandlerEvent(FileSystemCache.EVENT_CHANGED, new CacheHandlerEvent(changedFiles));
                    } catch (java.lang.reflect.UndeclaredThrowableException utex) {
                        String files = "";
                        for (java.util.Iterator it = changedFiles.iterator(); it.hasNext(); ) {
                            CacheFile file = (CacheFile) it.next();
                            files += file.toString() + ", parent = "+file.getParent()+"\n";
                        }
                        org.openide.ErrorManager.getDefault().notify((java.lang.reflect.UndeclaredThrowableException)
                            org.openide.ErrorManager.getDefault().annotate(utex,
                                "BAD cache files fired: "+files+", "+
                                "dir = "+dir+", registered dir for file '"+((VcsCacheDir) dir).getFile().getAbsolutePath()+"' = "+getDir(((VcsCacheDir) dir).getFile().getAbsolutePath())+
                                "\nPlease attach this text to issue #24340"));
                    }
                }
            }
            return changedFiles;
        }
        return Collections.EMPTY_SET;
    }
    
    public String getFileStatus(String path){
        //System.out.println("  VcsFSCache.getFileStatus("+path+")");
        CacheFile file = getFileOrDir(path, null);
        String stat;
        if (file != null) stat = file.getStatus();
        else {
            String dirPath = VcsUtilities.getDirNamePart(path);
            CacheDir dir = getDir(dirPath);
            if (dir != null && dir.isIgnored(VcsUtilities.getFileNamePart(path))) {
                stat = CacheStatuses.STATUS_IGNORED;
            } else {
                stat = localStatusStr;
            }
        }
        //System.out.println("   VcsFSCache.status = "+stat);
        return stat;
    }
    
    /**
     * Get the status info of a single file.
     * @param fullName the name of the file with respect to the filesystem root.
     */
    public FileStatusInfo getFileStatusInfo(String path) {
        String status = getFileStatus(path);
        if (status == null) return null;
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        if (fs != null) {
            Map statusInfoMap = fs.getPossibleFileStatusInfoMap();
            return (FileStatusInfo) statusInfoMap.get(status);
        } else return null;
    }
    
    public String getFileLocker(String path) {
        String locker = null;
        //if (isFile(path)) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) locker = file.getLocker();
        //}
        return locker;
    }
    
    public String getFileRevision(String path) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) return file.getRevision();
        else return null;
    }
    
    public String getFileSticky(String path) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) return file.getSticky();
        else return null;
    }
    
    public String getFileAttribute(String path) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) return file.getAttr();
        else return null;
    }

    public String getFileSize(String path) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) return ""+file.getSize(); // NOI18N
        else return null;
    }

    public String getFileDate(String path) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) return file.getDate();
        else return null;
    }

    public String getFileTime(String path) {
        CacheFile file = getFileOrDir(path, null);
        if (file != null) return file.getTime();
        else return null;
    }

    public void refreshDir(String path) {
        //System.out.println("VcsFSCache.refreshDir("+path+")");
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        if (fs != null) {
            FileCacheProvider cache = fs.getCacheProvider();
            if (cache != null) cache.refreshCacheDir(path);
        }
    }
    
    public void refreshDirRecursive(String path) {
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        if (fs != null) {
            FileCacheProvider cache = fs.getCacheProvider();
            if (cache != null) cache.refreshCacheDirRecursive(path);
        }
    }
    
    /* FileCacheProvider */
    
    public java.lang.ref.Reference createReference(org.openide.filesystems.FileObject fo) {
        String path = fo.getPath().replace('/', File.separatorChar);
        String absolutePath = getAbsolutePath(path);
        File file = new File(absolutePath);
        return CacheHandler.getInstance().createReference(fo, file, getCacheId());

    }

    public String getCacheId() {
        return cacheId;
    }
    
    public void setFSRoot(String fsRoot) {
        this.fsRoot = fsRoot;
    }
    
    public void setRelativeMountPoint(String relativeMountPoint) {
        this.relativeMountPoint = relativeMountPoint;
    }
    
    private String getAbsolutePath(String path) {
        //System.out.println("VcsFSCache.getAbsolutePath("+path+")");
        //if (path.length() > 0) {
        path = fsRoot + File.separator + relativeMountPoint + File.separator + path.replace('/', File.separatorChar);
        while (path.endsWith(File.separator) && path.length() > 1) path = path.substring(0, path.length() - 1);
        //} else {
        //    path = fsRoot;
        //}
        //System.out.println(" -> return '"+path+"'");
        return path;
    }
    
    private CacheFile getFileOrDir(String path, int strategy, Object locker) {
        //int currentStrategy = CacheHandler.STRAT_ALL;
        //System.out.println("VcsFSCache.getFileOrDir("+path+", "+strategy+")");
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        CacheFile file = null;
        if (fs != null) {
            FileCacheProvider cache = fs.getCacheProvider(); // XXX asking for myself/this here :-)
            if (cache != null) {
                path = getAbsolutePath(path);
                //System.out.println("Calling handler.getCacheFile("+new File(path)+", "+adjustStrategy(strategy)+")");
                file = handler.getCacheFile(new File(path), strategy, cache.getCacheId(), locker);
                //System.out.println("VcsFSCache.getFileOrDir: file = "+file);
            }
        }
        //System.out.println("getFileOrDir("+path+") = "+((file != null) ? file.getAbsolutePath() : "null"));
        return file;
    }
    
    private CacheFile getFileOrDir(String path, Object locker) {
        int strategy;
        VcsFileSystem fs = (VcsFileSystem) fileSystem.get();
        if (fs != null && fs.getAutoRefresh() == GeneralVcsSettings.AUTO_REFRESH_NO_REFRESH) {
            strategy = CacheHandler.STRAT_DISK;
        } else {
            strategy = CacheHandler.STRAT_DISK_OR_REFRESH;
        }
        return getFileOrDir(path, strategy, locker);
    }

    public CacheFile getFile(String path) {
        FileSystemCache cache = handler.getCache(getCacheId());
        path = getAbsolutePath(path);
        int sep = path.lastIndexOf(File.separatorChar);
        String pDirName = (sep < 0) ? "" : path.substring(0, sep); // NOI18N
        CacheDir dir = cache.getDir(pDirName);
        if (dir == null) return null;
        String name = (sep < 0) ? path : path.substring(sep + 1);
        return dir.getFile(name);
    }
    
    /**
     * Get the cache for the given directory.
     * @param path the directory path relative to the file system root
     */
    public CacheDir getDir(String path) {
        FileSystemCache cache = handler.getCache(getCacheId());
        path = getAbsolutePath(path);
        CacheDir dir = cache.getDir(path);
        if (dir == null) {
            int sep = path.lastIndexOf(File.separatorChar);
            String pDirName = (sep < 0) ? "" : path.substring(0, sep); // NOI18N
            CacheDir parent = cache.getDir(pDirName);
            if (parent == null) return null;
            String name = (sep < 0) ? path : path.substring(sep + 1);
            dir = parent.getSubDir(name);
        }
        return dir;
    }

    public boolean isFile(String path) {
        return (getFile(path) != null);
    }
    
    /**
     * Whether the path is a directory in the cache.
     * @param path the directory path relative to the file system root
     */
    public boolean isDir(String path) {
        //FileSystemCache cache = handler.getCache(getCacheId());
        //path = getAbsolutePath(path);
        return (getDir(path) != null);
    }
    
    /**
     * Try to asynchronously read the directory.
     */
    public void readDir(String path) {
        readDir(path, null);
    }
    
    /**
     * Try to asynchronously read the directory.
     */
    public void readDir(String path, Object locker) {
        getFileOrDir(path+"/test", locker); // downloads the dir // NOI18N
    }

    /**
     * Retrieve the directory from the disk cache (if any).
     */
    public void readDirFromDiskCache(String path) {
        readDirFromDiskCache(path, null);
    }
    
    /**
     * Retrieve the directory from the disk cache (if any).
     */
    public void readDirFromDiskCache(String path, Object locker) {
        /** get a dummy file in the 'path' directory to get the directory content - an awful hack */
        getFileOrDir(path+"/test", CacheHandler.STRAT_DISK_AND_LOCAL_REFRESH, locker); // NOI18N
    }
    
    /*
     * Try to asynchronously read the directory.
     * @param strategy the desired strategy
     *
    public void readDir(String path, int strategy) {
        getFileOrDir(path, strategy); // downloads the dir
    }
     */

    /*
    public void setLocalFilesAdd (boolean localFilesAdd) {
        this.localFilesAdd = localFilesAdd;
    }

    public boolean isLocalFilesAdd () {
        return localFilesAdd;
    }
     */
    
    public String[] getFilesAndSubdirs(String path) {
        VcsCacheDir dir = (VcsCacheDir) getDir(path);
        if (dir == null) return null;
        return dir.getFilesAndSubdirs();
    }

    /** Force refresh of directory from disk cache. Delete the directory only from memory cache
     * and read it.
     * @param path complete name of directory to refresh
     *
    public void refreshDirFromDiskCache(File dir) {
        CacheFile cfile = handler.getCacheFile(dir, CacheHandler.STRAT_DISK, getCacheId());
        //cfile.
    }
     */

    public void refreshCacheDir(String path) {
        //System.out.println("VcsFSCache.refreshCacheDir("+path+")");
        VcsFileSystem fsystem = (VcsFileSystem) fileSystem.get();
        if (fsystem.isOffLine() &&
            fsystem.getCommand(org.netbeans.modules.vcscore.commands.VcsCommand.NAME_REFRESH +
                               org.netbeans.modules.vcscore.commands.VcsCommand.NAME_SUFFIX_OFFLINE) == null) {
            if (NotifyDescriptor.Confirmation.YES_OPTION.equals (
                DialogDisplayer.getDefault ().notify (new NotifyDescriptor.Confirmation (
                    g("DLG_RefreshCommandDisabled"), NotifyDescriptor.Confirmation.YES_NO_OPTION)))) { // NOI18N
                fsystem.setOffLine(false);
            } else {
                return ;
            }
        }
        FileSystemCache cache = handler.getCache(getCacheId());
        String apath = getAbsolutePath(path);
        CacheDir dir = cache.getDir(apath);
        //System.out.println("cache for path = "+apath+" is "+dir);
        if (dir == null) {
            apath = VcsUtilities.getDirNamePart(apath);
            dir = cache.getDir(apath);
            if (dir == null) {
                //dir = ((VcsCache) cache).initCacheDir(path);
                getFileOrDir(VcsUtilities.getDirNamePart(path), null);
                return ;
            }
        }
        ((VcsCache) cache).doRefreshDir(dir, false);
    }

    public void refreshCacheDirRecursive(String path) {
        VcsFileSystem fsystem = (VcsFileSystem) fileSystem.get();
        if (fsystem.isOffLine() &&
            fsystem.getCommand(org.netbeans.modules.vcscore.commands.VcsCommand.NAME_REFRESH +
                               org.netbeans.modules.vcscore.commands.VcsCommand.NAME_SUFFIX_OFFLINE) == null &&
            fsystem.getCommand(org.netbeans.modules.vcscore.commands.VcsCommand.NAME_REFRESH_RECURSIVELY +
                               org.netbeans.modules.vcscore.commands.VcsCommand.NAME_SUFFIX_OFFLINE) == null) {
            
            if (NotifyDescriptor.Confirmation.YES_OPTION.equals (
                DialogDisplayer.getDefault ().notify (new NotifyDescriptor.Confirmation (
                    g("DLG_RefreshCommandDisabled"), NotifyDescriptor.Confirmation.YES_NO_OPTION)))) { // NOI18N
                fsystem.setOffLine(false);
            } else {
                return ;
            }
        }
        FileSystemCache cache = handler.getCache(getCacheId());
        //CacheFile file = handler.getCacheFile(new File(path), adjustStrategy(strategy), cache);
        String fullPath = getAbsolutePath(path);
        CacheDir dir = cache.getDir(fullPath);
        Object refreshDirsLocker = new Object();
        if (dir == null) {
            fullPath = VcsUtilities.getDirNamePart(fullPath);
            dir = cache.getDir(fullPath);
            if (dir == null && "".equals(path)) { // NOI18N
                dir = (CacheDir) cache.getCacheFile(fsystem.getFile(path), CacheHandler.STRAT_DISK, refreshDirsLocker);
            }
            if (dir == null) return ;
        }
        ((VcsCache) cache).doRefreshDir(dir, true, refreshDirsLocker);
    }

    public void refreshDirFromDiskCache(File fpath) {
        refreshDirFromDiskCache(fpath, null);
    }

    public void refreshDirFromDiskCache(File fpath, Object locker) {
        FileSystemCache cache = handler.getCache(getCacheId());
        String path = fpath.getAbsolutePath();
        CacheDir dir = cache.getDir(path);
        if (dir == null) {
            path = VcsUtilities.getDirNamePart(path);
            dir = cache.getDir(path);
            if (dir == null) return;
        }
        dir.readFromDisk(locker);
    }
    
    public void addFolder(String path) {
        FileSystemCache cache = handler.getCache(getCacheId());
        File file = new File(getAbsolutePath(path));
        CacheDir dir = cache.getDir(file.getParent());
        if (dir != null) {
            VcsCacheDir localDir = new VcsCacheDir(cache.getId(), file);
            localDir.setLocal(true);
            localDir.setStatus(getLocalFileStatus());
            dir.addChildDir(localDir, true);
            cache.registerDir(localDir);
        }
    }

    public void addFile(String path) {
        FileSystemCache cache = handler.getCache(getCacheId());
        cache.getCacheFile(new File(getAbsolutePath(path)), CacheHandler.STRAT_LOCAL, null);
    }
    
    public void rename(String oldPath, String newPath) {
        //System.out.println("VcsFSCache.rename("+oldPath+", "+newPath+")");
        FileSystemCache cache = handler.getCache(getCacheId());
        CacheFile file = cache.getCacheFile(new File(getAbsolutePath(oldPath)), CacheHandler.STRAT_LOCAL, null);
        //System.out.println("cache file = '"+file+"' for File '"+getAbsolutePath(oldPath)+"'.");
        if (file == null) return ;
        String newParentPath = VcsUtilities.getDirNamePart(newPath);
        CacheDir newParent = (CacheDir) cache.getCacheFile(new File(getAbsolutePath(newParentPath)), CacheHandler.STRAT_LOCAL, null);
        String newFileName = VcsUtilities.getFileNamePart(newPath);
        if (newParent != null && newParent.equals(file.getParent())) {
            newParent.renameChild(file.getName(), newFileName, true);
        } else {
            if (file instanceof VcsCacheFile) {
                if (((VcsCacheFile) file).isLocal()) {
                    file.getParent().removeFile(file.getName(), true);
                    if (newParent != null) {
                        file.setName(newFileName);
                        newParent.addFile(file, true);
                    }
                }
            } else if (file instanceof VcsCacheDir) {
                if (((VcsCacheDir) file).isLocal()) {
                    file.getParent().removeChildDir(file.getName(), true);
                    if (newParent != null) {
                        file.setName(newFileName);
                        newParent.addChildDir((CacheDir) file, true);
                    }
                }
            }
        }
    }
    
    public void remove(String path, boolean wasDirectory) {
    //public void removeFromCache(File deletedFile, boolean wasDirectory) {
        CacheDir parent = null;
        if (wasDirectory) {
            CacheDir dir = getDir(path);
            if (dir != null) {
                parent = dir.getParent();
                if (parent != null) parent.removeChildDir(dir.getName(), true);
            }
        } else {
            CacheFile file = getFile(path);
            if (file != null) {
                parent = file.getParent();
                parent.removeFile(file.getName(), true);
            }
        }
    }

    private String g(String s) {
        return NbBundle.getMessage(VcsFSCache.class, s);
    }

}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.