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 181684
Collapse All | Expand All

(-)a/versioning/apichanges.xml (+15 lines)
Lines 108-113 Link Here
108
        
108
        
109
        <change>
109
        <change>
110
            <api name="versioning_spi"/>
110
            <api name="versioning_spi"/>
111
            <summary>refreshRecursively() method added to VCSInterceptor</summary>
112
            <version major="1" minor="17"/>
113
            <date day="12" month="4" year="2010"/>
114
            <author login="ovrabec"/>
115
            <compatibility addition="yes"/>
116
            <description>
117
                <code>VCSInterceptor.refreshRecursively</code> allows a version control system to get better control on behavior of recursive listener.
118
                With this method a versioning system can disable recursive listening on specific folders (e.g. versioning system metadata) and on the other hand 
119
                learn about and handle external changes inside the folder in its own way.
120
            </description>
121
            <class package="org.netbeans.modules.versioning.spi" name="VCSInterceptor"/>
122
            <issue number="181684"/>
123
        </change>
124
        <change>
125
            <api name="versioning_spi"/>
111
            <summary>Added getVisibilityQueryImplementation() method to VersioningSystem</summary>
126
            <summary>Added getVisibilityQueryImplementation() method to VersioningSystem</summary>
112
            <version major="1" minor="10"/>
127
            <version major="1" minor="10"/>
113
            <date day="8" month="12" year="2009"/>
128
            <date day="8" month="12" year="2009"/>
(-)a/versioning/nbproject/project.properties (-1 / +1 lines)
Lines 41-47 Link Here
41
javac.source=1.6
41
javac.source=1.6
42
42
43
javadoc.name=Versioning
43
javadoc.name=Versioning
44
spec.version.base=1.16.0
44
spec.version.base=1.17.0
45
is.autoload=true
45
is.autoload=true
46
46
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
(-)a/versioning/src/org/netbeans/modules/versioning/FilesystemInterceptor.java (-3 / +17 lines)
Lines 142-147 Link Here
142
        getInterceptor(FileUtil.toFile(fo), fo.isFolder(), "beforeChange").beforeChange(); // NOI18N
142
        getInterceptor(FileUtil.toFile(fo), fo.isFolder(), "beforeChange").beforeChange(); // NOI18N
143
    }
143
    }
144
144
145
    @Override
146
    public long refreshRecursively(File dir, long lastTimeStamp, List<? super File> children) {
147
        DelegatingInterceptor interceptor = getRefreshInterceptor(dir);
148
        return interceptor.refreshRecursively(dir, lastTimeStamp, children);
149
    }
150
145
    private boolean needsLH(String... methodNames) {
151
    private boolean needsLH(String... methodNames) {
146
        for (String methodName : methodNames) {
152
        for (String methodName : methodNames) {
147
            if(master.needsLocalHistory(methodName)) {
153
            if(master.needsLocalHistory(methodName)) {
Lines 316-321 Link Here
316
        return new DelegatingInterceptor(vsInterceptor, localHistoryInterceptor, from, to, false);
322
        return new DelegatingInterceptor(vsInterceptor, localHistoryInterceptor, from, to, false);
317
    }
323
    }
318
324
325
    private DelegatingInterceptor getRefreshInterceptor (File dir) {
326
        if (dir == null) return nullDelegatingInterceptor;
327
        VersioningSystem vs = master.getOwner(dir);
328
        VCSInterceptor vcsInterceptor = vs != null ? vs.getVCSInterceptor() : nullVCSInterceptor;
329
        return new DelegatingInterceptor(vcsInterceptor, nullVCSInterceptor, dir, null, true);
330
    }
331
319
    private final DelegatingInterceptor nullDelegatingInterceptor = new DelegatingInterceptor() {
332
    private final DelegatingInterceptor nullDelegatingInterceptor = new DelegatingInterceptor() {
320
        public boolean beforeDelete() { return false; }
333
        public boolean beforeDelete() { return false; }
321
        public void doDelete() throws IOException {  }
334
        public void doDelete() throws IOException {  }
Lines 501-509 Link Here
501
                return false;
514
                return false;
502
            }
515
            }
503
        }
516
        }
504
//        VCSInterceptor getInterceptor() {
517
505
//            return interceptor;
518
        public long refreshRecursively (File dir, long lastTimeStamp, List<? super File> children) {
506
//        }
519
            return interceptor.refreshRecursively(dir, lastTimeStamp, children);
520
        }
507
    }
521
    }
508
522
509
    private class FileEx {
523
    private class FileEx {
(-)a/versioning/src/org/netbeans/modules/versioning/spi/VCSInterceptor.java (+19 lines)
Lines 42-47 Link Here
42
42
43
import java.io.File;
43
import java.io.File;
44
import java.io.IOException;
44
import java.io.IOException;
45
import java.util.List;
45
46
46
/**
47
/**
47
 * Versioning systems that need to intercept or listen to file system operations implement this class.  
48
 * Versioning systems that need to intercept or listen to file system operations implement this class.  
Lines 226-229 Link Here
226
     */
227
     */
227
    public void beforeEdit(File file) {
228
    public void beforeEdit(File file) {
228
    }
229
    }
230
231
    /** Allows versioning system to exclude some children from recursive
232
     * listening check. Also notifies the versioning whenever a refresh
233
     * is required and allows the versioning to provide special timestamp
234
     * for a directory.
235
     *
236
     * @param dir the directory to check timestamp for
237
     * @param lastTimeStamp the previously known timestamp or -1
238
     * @param children add children that shall be integrated into this array
239
     * @return the timestamp that shall represent this directory, it will
240
     *   be compared with timestamps of all children and the newest
241
     *   one will be kept and next time passed as lastTimeStamp. Return
242
     *   0 if the directory does not have any special timestamp
243
     * @since 1.17
244
     */
245
    public long refreshRecursively(File dir, long lastTimeStamp, List<? super File> children) {
246
        return -1;
247
    }
229
}
248
}

Return to bug 181684