# HG changeset patch # User Alexander Simon # Date 1410348698 -14400 # Wed Sep 10 15:31:38 2014 +0400 # Node ID 576f36e60963c3d6a1c45915ec409afd10600129 # Parent 5a0bda91d17c0172f4d920693e90faf77976b6b1 fixed Bug 225063 Project infrastructure should be aware of mounted file systems diff --git a/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java b/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java --- a/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java +++ b/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java @@ -51,8 +51,10 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.logging.Level; @@ -77,6 +79,18 @@ public class SimpleFileOwnerQueryImplementation implements FileOwnerQueryImplementation { private static final Logger LOG = Logger.getLogger(SimpleFileOwnerQueryImplementation.class.getName()); private static final URI UNOWNED_URI = URI.create("http:unowned"); + private static final Set forbiddenFolders; + static { + Set files = new HashSet(); + try { + String forbidden = System.getProperty("project.forbiddenFolders", System.getProperty("versioning.forbiddenFolders", "")); //NOI18N + files.addAll(Arrays.asList(forbidden.split("\\;"))); //NOI18N + files.remove(""); //NOI18N + } catch (Exception e) { + LOG.log(Level.INFO, e.getMessage(), e); + } + forbiddenFolders = files; + } /** Do nothing */ public SimpleFileOwnerQueryImplementation() {} @@ -124,22 +138,24 @@ } boolean folder = f.isFolder(); if (folder) { - Project p; - try { - p = ProjectManager.getDefault().findProject(f); - } catch (IOException e) { - // There is a project here, but we cannot load it... - if (warnedAboutBrokenProjects.add(f)) { // #60416 - LOG.log(Level.FINE, "Cannot load project.", e); //NOI18N + if (!forbiddenFolders.contains(f.getPath())) { + Project p; + try { + p = ProjectManager.getDefault().findProject(f); + } catch (IOException e) { + // There is a project here, but we cannot load it... + if (warnedAboutBrokenProjects.add(f)) { // #60416 + LOG.log(Level.FINE, "Cannot load project.", e); //NOI18N + } + return null; } - return null; - } - if (p != null) { - synchronized (this) { - lastFoundKey = new WeakReference(f); - lastFoundValue = new WeakReference(p); + if (p != null) { + synchronized (this) { + lastFoundKey = new WeakReference(f); + lastFoundValue = new WeakReference(p); + } + return p; } - return p; } }