This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 225063
Collapse All | Expand All

(-)a/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java (-14 / +33 lines)
Lines 51-58 Link Here
51
import java.net.URI;
51
import java.net.URI;
52
import java.net.URISyntaxException;
52
import java.net.URISyntaxException;
53
import java.net.URL;
53
import java.net.URL;
54
import java.util.ArrayList;
55
import java.util.Arrays;
56
import java.util.Collection;
54
import java.util.Collections;
57
import java.util.Collections;
55
import java.util.HashMap;
58
import java.util.HashMap;
59
import java.util.HashSet;
60
import java.util.List;
56
import java.util.Map;
61
import java.util.Map;
57
import java.util.Set;
62
import java.util.Set;
58
import java.util.logging.Level;
63
import java.util.logging.Level;
Lines 77-82 Link Here
77
public class SimpleFileOwnerQueryImplementation implements FileOwnerQueryImplementation {
82
public class SimpleFileOwnerQueryImplementation implements FileOwnerQueryImplementation {
78
    private static final Logger LOG = Logger.getLogger(SimpleFileOwnerQueryImplementation.class.getName());
83
    private static final Logger LOG = Logger.getLogger(SimpleFileOwnerQueryImplementation.class.getName());
79
    private static final URI UNOWNED_URI = URI.create("http:unowned");
84
    private static final URI UNOWNED_URI = URI.create("http:unowned");
85
    private static final Set<String> forbiddenFolders;
86
    static {
87
        Set<String> files = new HashSet<String>();
88
        try {
89
            String forbidden = System.getProperty("versioning.forbiddenFolders", ""); //NOI18N
90
            files.addAll(Arrays.asList(forbidden.split("\\;"))); //NOI18N
91
            files.remove(""); //NOI18N
92
        } catch (Exception e) {
93
            LOG.log(Level.INFO, e.getMessage(), e);
94
        }
95
        forbiddenFolders = files;
96
    }
80
    
97
    
81
    /** Do nothing */
98
    /** Do nothing */
82
    public SimpleFileOwnerQueryImplementation() {}
99
    public SimpleFileOwnerQueryImplementation() {}
Lines 124-145 Link Here
124
            }
141
            }
125
            boolean folder = f.isFolder();
142
            boolean folder = f.isFolder();
126
            if (folder) {
143
            if (folder) {
127
                Project p;
144
                if (!forbiddenFolders.contains(f.getPath())) {
128
                try {
145
                    Project p;
129
                    p = ProjectManager.getDefault().findProject(f);
146
                    try {
130
                } catch (IOException e) {
147
                        p = ProjectManager.getDefault().findProject(f);  //Do we need chek /net ?
131
                    // There is a project here, but we cannot load it...
148
                    } catch (IOException e) {
132
                    if (warnedAboutBrokenProjects.add(f)) { // #60416
149
                        // There is a project here, but we cannot load it...
133
                        LOG.log(Level.FINE, "Cannot load project.", e); //NOI18N
150
                        if (warnedAboutBrokenProjects.add(f)) { // #60416
151
                            LOG.log(Level.FINE, "Cannot load project.", e); //NOI18N
152
                        }
153
                        return null;
134
                    }
154
                    }
135
                    return null;
155
                    if (p != null) {
136
                }
156
                        synchronized (this) {
137
                if (p != null) {
157
                            lastFoundKey = new WeakReference<FileObject>(f);
138
                    synchronized (this) {
158
                            lastFoundValue = new WeakReference<Project>(p);
139
                        lastFoundKey = new WeakReference<FileObject>(f);
159
                        }
140
                        lastFoundValue = new WeakReference<Project>(p);
160
                        return p;
141
                    }
161
                    }
142
                    return p;
143
                }
162
                }
144
            }
163
            }
145
            
164
            

Return to bug 225063