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

(-)a/dlight.nativeexecution/nbproject/project.xml (+1 lines)
Lines 270-275 Link Here
270
                <friend>org.netbeans.modules.dlight.uncover</friend>
270
                <friend>org.netbeans.modules.dlight.uncover</friend>
271
                <friend>org.netbeans.modules.dlight.util</friend>
271
                <friend>org.netbeans.modules.dlight.util</friend>
272
                <friend>org.netbeans.modules.dlight.webstack</friend>
272
                <friend>org.netbeans.modules.dlight.webstack</friend>
273
                <friend>org.netbeans.modules.fsbridge</friend>
273
                <friend>org.netbeans.nativeexecution.terminal</friend>
274
                <friend>org.netbeans.nativeexecution.terminal</friend>
274
                <package>org.netbeans.modules.nativeexecution.api</package>
275
                <package>org.netbeans.modules.nativeexecution.api</package>
275
                <package>org.netbeans.modules.nativeexecution.api.execution</package>
276
                <package>org.netbeans.modules.nativeexecution.api.execution</package>
(-)a/dlight.remote.impl/nbproject/project.xml (+17 lines)
Lines 57-62 Link Here
57
                    </run-dependency>
57
                    </run-dependency>
58
                </dependency>
58
                </dependency>
59
                <dependency>
59
                <dependency>
60
                    <code-name-base>org.netbeans.modules.fsbridge</code-name-base>
61
                    <build-prerequisite/>
62
                    <compile-dependency/>
63
                    <run-dependency>
64
                        <specification-version>1.0</specification-version>
65
                    </run-dependency>
66
                </dependency>
67
                <dependency>
68
                    <code-name-base>org.netbeans.modules.masterfs</code-name-base>
69
                    <build-prerequisite/>
70
                    <compile-dependency/>
71
                    <run-dependency>
72
                        <release-version>2</release-version>
73
                        <specification-version>2.32.1</specification-version>
74
                    </run-dependency>
75
                </dependency>
76
                <dependency>
60
                    <code-name-base>org.openide.awt</code-name-base>
77
                    <code-name-base>org.openide.awt</code-name-base>
61
                    <build-prerequisite/>
78
                    <build-prerequisite/>
62
                    <compile-dependency/>
79
                    <compile-dependency/>
(-)a/fsbridge/build.xml (+5 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project basedir="." default="netbeans" name="fsbridge">
3
    <description>Builds, tests, and runs the project org.netbeans.modules.fsbridge</description>
4
    <import file="../nbbuild/templates/projectized.xml"/>
5
</project>
(-)a/fsbridge/manifest.mf (+5 lines)
Line 0 Link Here
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.fsbridge
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/fsbridge/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.0
5
(-)a/fsbridge/nbproject/project.properties (+2 lines)
Line 0 Link Here
1
javac.source=1.6
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)a/fsbridge/nbproject/project.xml (+41 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://www.netbeans.org/ns/project/1">
3
    <type>org.netbeans.modules.apisupport.project</type>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>org.netbeans.modules.fsbridge</code-name-base>
7
            <module-dependencies>
8
                <dependency>
9
                    <code-name-base>org.netbeans.modules.dlight.nativeexecution</code-name-base>
10
                    <build-prerequisite/>
11
                    <compile-dependency/>
12
                    <run-dependency>
13
                        <specification-version>1.10.3</specification-version>
14
                    </run-dependency>
15
                </dependency>
16
                <dependency>
17
                    <code-name-base>org.netbeans.modules.masterfs</code-name-base>
18
                    <build-prerequisite/>
19
                    <compile-dependency/>
20
                    <run-dependency>
21
                        <release-version>2</release-version>
22
                        <specification-version>2.32.1</specification-version>
23
                    </run-dependency>
24
                </dependency>
25
                <dependency>
26
                    <code-name-base>org.openide.filesystems</code-name-base>
27
                    <build-prerequisite/>
28
                    <compile-dependency/>
29
                    <run-dependency>
30
                        <specification-version>7.47.1</specification-version>
31
                    </run-dependency>
32
                </dependency>
33
            </module-dependencies>
34
            <friend-packages>
35
                <friend>org.netbeans.modules.dlight.remote.impl</friend>
36
                <friend>org.netbeans.modules.versioning</friend>
37
                <package>org.netbeans.modules.fsbridge.spi</package>
38
            </friend-packages>
39
        </data>
40
    </configuration>
41
</project>
(-)a/fsbridge/src/org/netbeans/modules/fsbridge/Bundle.properties (+5 lines)
Line 0 Link Here
1
OpenIDE-Module-Display-Category=Infrastructure
2
OpenIDE-Module-Long-Description=\
3
    Remote File System Bridge
4
OpenIDE-Module-Name=Remote File System Bridge
5
OpenIDE-Module-Short-Description=Remote File System Bridge
(-)a/fsbridge/src/org/netbeans/modules/fsbridge/spi/Bridge.java (+164 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.fsbridge.spi;
43
44
import java.io.File;
45
import java.io.IOException;
46
import java.lang.reflect.InvocationTargetException;
47
import java.lang.reflect.Method;
48
import java.util.logging.Level;
49
import java.util.logging.Logger;
50
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment;
51
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
52
import org.openide.filesystems.FileObject;
53
import org.openide.filesystems.FileStateInvalidException;
54
import org.openide.filesystems.FileSystem;
55
import org.openide.filesystems.FileUtil;
56
57
/**
58
 *
59
 * @author Alexander Simon
60
 */
61
public final class Bridge {
62
63
    private static FileSystem rootFileSystem;
64
65
    static {
66
        File tmpFile = null;
67
        try {
68
            tmpFile = File.createTempFile("NetBeans", ".tmp"); //NOI18N
69
            tmpFile = FileUtil.normalizeFile(tmpFile);
70
            FileObject fo = FileUtil.toFileObject(tmpFile);
71
            rootFileSystem = fo.getFileSystem();
72
        } catch (IOException ex) {
73
            Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
74
        } finally {
75
            if (tmpFile != null) {
76
                tmpFile.delete();
77
            }
78
        }
79
    }
80
81
    private Bridge() {
82
    }
83
84
    public static FileProxy toLocalFileProxy(File file) {
85
        return new FileProxy(file.getAbsolutePath(), rootFileSystem, true);
86
    }
87
88
    public static FileProxy toFileProxy(FileObject file) {
89
        try {
90
            FileSystem fileSystem = file.getFileSystem();
91
            return new FileProxy(file.getPath(), fileSystem, !isRemote(fileSystem));
92
        } catch (FileStateInvalidException ex) {
93
            Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
94
        }
95
        return new FileProxy(file.getPath(), rootFileSystem, true);
96
    }
97
98
    public static FileProxy toFileProxy(FileSystem fs, String path) {
99
        if (isRemote(fs)) {
100
            try {
101
                //TODO: provide SPI
102
                Class<?> cls = Class.forName("org.netbeans.modules.remote.spi.FileSystemProvider"); //NOI18N
103
                if (cls != null) {
104
                    Method method = cls.getMethod("normalizeAbsolutePath", String.class, FileSystem.class); //NOI18N
105
                    if (method != null) {
106
                        path = (String) method.invoke(cls, path, fs);
107
                    }
108
                }
109
            } catch (IllegalAccessException ex) {
110
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
111
            } catch (IllegalArgumentException ex) {
112
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
113
            } catch (InvocationTargetException ex) {
114
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
115
            } catch (NoSuchMethodException ex) {
116
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
117
            } catch (SecurityException ex) {
118
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
119
            } catch (ClassNotFoundException ex) {
120
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
121
            }
122
            
123
        } else {
124
            path = FileUtil.normalizePath(path);
125
        }
126
        return new FileProxy(path, fs, !isRemote(fs));
127
    }
128
129
    public static FileObject toFileObject(FileProxy path) {
130
        return path.getFileSystem().findResource(path.getAbsolutePath());
131
    }
132
133
    public static ExecutionEnvironment getExecutionEnvironment(FileProxy path) {
134
        FileSystem fs = path.getFileSystem();
135
        if (isRemote(fs)) {
136
            //TODO: provide SPI
137
            Class<? extends FileSystem> aClass = fs.getClass();
138
            try {
139
                Method method = aClass.getMethod("getExecutionEnvironment"); //NOI18N
140
                return (ExecutionEnvironment) method.invoke(fs);
141
            } catch (IllegalArgumentException ex) {
142
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
143
            } catch (InvocationTargetException ex) {
144
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
145
            } catch (NoSuchMethodException ex) {
146
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
147
            } catch (SecurityException ex) {
148
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
149
            } catch (IllegalAccessException ex) {
150
                Logger.getLogger(Bridge.class.getName()).log(Level.SEVERE, null, ex);
151
            }
152
        }
153
        return ExecutionEnvironmentFactory.getLocal();
154
    }
155
156
    private static boolean isRemote(FileSystem fs) {
157
        //TODO: provide SPI
158
        Class<? extends FileSystem> aClass = fs.getClass();
159
        if ("org.netbeans.modules.remote.impl.fs.RemoteFileSystem".equals(aClass.getName())) { //NOI18N
160
            return true;
161
        }
162
        return false;
163
    }
164
}
(-)a/fsbridge/src/org/netbeans/modules/fsbridge/spi/FileProxy.java (+183 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.fsbridge.spi;
43
44
import java.io.File;
45
import org.openide.filesystems.FileObject;
46
import org.openide.filesystems.FileSystem;
47
48
/**
49
 * Represents file on remote or local file system.
50
 *
51
 * @author Alexander Simon
52
 */
53
public final class FileProxy {
54
55
    private final String path;
56
    private final FileSystem fs;
57
    private final boolean isLocal;
58
59
    FileProxy(String path, FileSystem fs, boolean isLocal) {
60
        this.path = path;
61
        this.fs = fs;
62
        this.isLocal = isLocal;
63
    }
64
65
    /**
66
     *
67
     * @return File system (remote or local)
68
     */
69
    FileSystem getFileSystem() {
70
        return fs;
71
    }
72
73
    /**
74
     *
75
     * @return Absolute path to file in file system.
76
     */
77
    public String getAbsolutePath() {
78
        return path;
79
    }
80
81
    public String getName() {
82
        if (isLocal) {
83
            return new File(path).getName();
84
        } else {
85
            int index = path.lastIndexOf('/');
86
            if (index >= 0) {
87
                return path.substring(index + 1);
88
            } else {
89
                return ""; //NOI18N
90
            }
91
        }
92
    }
93
94
    public boolean isDirectory() {
95
        if (isLocal) {
96
            return new File(path).isDirectory();
97
        }
98
        FileObject fo = Bridge.toFileObject(this);
99
        return fo == null ? false : fo.isFolder();
100
    }
101
102
    public boolean isFile() {
103
        if (isLocal) {
104
            return new File(path).isFile();
105
        } else {
106
            FileObject fo = Bridge.toFileObject(this);
107
            return fo == null ? false : fo.isData();
108
        }
109
    }
110
111
    public boolean canWrite() {
112
        if (isLocal) {
113
            return new File(path).canWrite();
114
        } else {
115
            FileObject fo = Bridge.toFileObject(this);
116
            return fo == null ? false : fo.canWrite();
117
        }
118
    }
119
120
    public FileProxy getParentFile() {
121
        if (isLocal) {
122
            String parent = new File(path).getParent();
123
            if (parent != null) {
124
                return new FileProxy(parent, fs, isLocal);
125
            }
126
        } else {
127
            int index = path.lastIndexOf('/');
128
            if (index >= 0) {
129
                String parent = path.substring(0, index);
130
                return new FileProxy(parent, fs, isLocal);
131
            }
132
        }
133
        return null;
134
    }
135
    
136
    public boolean exists() {
137
        if (isLocal) {
138
            return new File(path).exists();
139
        } else {
140
            FileObject fo = Bridge.toFileObject(this);
141
            return fo == null ? false : fo.isValid();
142
        }
143
    }
144
145
    public FileProxy newFileProxy(String name) {
146
        if (isLocal) {
147
            return Bridge.toLocalFileProxy(new File(path,name));
148
        } else {
149
            return Bridge.toFileProxy(fs, path+'/'+name);
150
        }
151
    }
152
    
153
    @Override
154
    public String toString() {
155
        return fs + " " + path; //NOI18N
156
    }
157
158
    @Override
159
    public int hashCode() {
160
        int hash = 3;
161
        hash = 59 * hash + (this.path != null ? this.path.hashCode() : 0);
162
        hash = 59 * hash + (this.fs != null ? this.fs.hashCode() : 0);
163
        return hash;
164
    }
165
166
    @Override
167
    public boolean equals(Object obj) {
168
        if (obj == null) {
169
            return false;
170
        }
171
        if (getClass() != obj.getClass()) {
172
            return false;
173
        }
174
        final FileProxy other = (FileProxy) obj;
175
        if (this.fs != other.fs && (this.fs == null || !this.fs.equals(other.fs))) {
176
            return false;
177
        }
178
        if ((this.path == null) ? (other.path != null) : !this.path.equals(other.path)) {
179
            return false;
180
        }
181
        return true;
182
    }
183
}
(-)a/fsbridge/src/org/netbeans/modules/fsbridge/spi/ProvidedExtensions2.java (+207 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.fsbridge.spi;
43
44
import java.util.List;
45
import org.netbeans.modules.masterfs.providers.ProvidedExtensions;
46
import org.openide.filesystems.FileObject;
47
48
/**
49
 * Extension of {@link ProvidedExtensions} to process remote file operations.
50
 * 
51
 * The interface is intended to be implemented in remote file system and VCS
52
 * when modules extend class ProvidedExtensions.
53
 * 
54
 * @author Alexander Simon
55
 */
56
public interface ProvidedExtensions2 {
57
    /**
58
     * Return instance of {@link ProvidedExtensions.IOHandler}
59
     * that is responsible for copying the file or null.
60
     *
61
     * Just the first non null instance of <code>IOHandler</code> is used by
62
     *  <code>RemoteFileSystem</code>
63
     *
64
     * @param from file to be copied
65
     * @param to target to copy this file to
66
     * @return instance of {@link ProvidedExtensions.IOHandler}
67
     * that is responsible for copying the file or null
68
     */
69
    ProvidedExtensions.IOHandler getCopyHandler(FileProxy from, FileProxy to);
70
71
    /**
72
     * Return instance of {@link ProvidedExtensions.IOHandler}
73
     * that is responsible for moving the file or null.
74
     *
75
     * Just the first non null instance of <code>IOHandler</code> is used by
76
     *  <code>RemoteFileSystem</code>
77
     *
78
     * @param from file to be moved
79
     * @param to target to move this file to
80
     * @return instance of {@link ProvidedExtensions.IOHandler} 
81
     * that is responsible for moving the file or null
82
     */
83
    ProvidedExtensions.IOHandler getMoveHandler(FileProxy from, FileProxy to);
84
    
85
    /*
86
     * Return instance of {@link ProvidedExtensions.IOHandler}
87
     * that is responsible for renaming the file or null.
88
     *
89
     * Just the first non null instance of <code>IOHandler</code> is used by
90
     *  <code>RemoteFileSystem</code>
91
     *
92
     * @param from file to be renamed
93
     * @param newName new name of file
94
     * @return instance of {@link ProvidedExtensions.IOHandler} 
95
     * that is responsible for renaming the file or null
96
     */
97
    ProvidedExtensions.IOHandler getRenameHandler(FileProxy from, String newName);
98
99
    /*
100
     * Return instance of {@link ProvidedExtensions.DeleteHandler}
101
     * that is responsible for deleting the file or null.
102
     *
103
     * Just the first non null instance of <code>DeleteHandler</code> is used by
104
     *  <code>RemoteFileSystem</code>
105
     *
106
     * @param f file or folder to be deleted
107
     * @return instance of {@link ProvidedExtensions2.DeleteHandler2} 
108
     * that is responsible for deleting the file or null
109
     */    
110
    ProvidedExtensions2.DeleteHandler2 getDeleteHandler(FileProxy f);
111
    
112
    public interface DeleteHandler2 {
113
        /**
114
         * Deletes the file or directory denoted by this abstract pathname.  If
115
         * this pathname denotes a directory, then the directory must be empty in
116
         * order to be deleted.
117
         *
118
         * @return  <code>true</code> if and only if the file or directory is
119
         *          successfully deleted; <code>false</code> otherwise
120
         */
121
        boolean delete(FileProxy file);
122
    }
123
    
124
    /**
125
     * Called by <code>RemoteFileSystem</code> before <code>FileObject</code>
126
     * is copied
127
     * @param from FileObject to be moved
128
     * @param to FileProxy target to move this file to
129
     */
130
    void beforeCopy(FileObject from, FileProxy to);
131
132
    /**
133
     * Called by <code>RemoteFileSystem</code> after <code>FileObject</code>
134
     * was successfully copied
135
     * @param from FileObject to be moved
136
     * @param to FileProxy target to move this file to
137
     */
138
    void copySuccess(FileObject from, FileProxy to);
139
140
    /**
141
     * Called by <code>RemoteFileSystem</code> after a <code>FileObject</code>
142
     * copy failed
143
     * @param from FileObject to be moved
144
     * @param to FileProxy target to move this file to
145
     */
146
    void copyFailure(FileObject from, FileProxy to);
147
148
    /**
149
     * Called by <code>RemoteFileSystem</code> before <code>FileObject</code>
150
     * is moved
151
     * @param from FileObject to be moved
152
     * @param to FileProxy target to move this file to
153
     */
154
    void beforeMove(FileObject from, FileProxy to);
155
156
    /**
157
     * Called by <code>RemoteFileSystem</code> after <code>FileObject</code>
158
     * was successfully
159
     * @param from FileObject to be moved
160
     * @param to FileProxy target to move this file to
161
     */
162
    void moveSuccess(FileObject from, FileProxy to);
163
164
    /**
165
     * Called by <code>RemoteFileSystem</code> after a <code>FileObject</code>
166
     * move failed
167
     * @param from FileObject to be moved
168
     * @param to FileProxy target to move this file to
169
     */
170
    void moveFailure(FileObject from, FileProxy to);
171
172
    /**
173
     * Called by <code>RemoteFileSystem</code> when <code>FileObject</code> is queried for writability with the
174
     * canWrite() method.
175
     * 
176
     * @param f a FileProxy to query
177
     * @return true if the file can be written to, deleted or moved, false otherwise
178
     */
179
    boolean canWrite(FileProxy f);
180
181
    /**
182
     * Called by {@code RemoteFileSystem} when {@code FileObject} is
183
     * queried for attribute and attribute's name starts with {@code ProvidedExtensions}
184
     * prefix.
185
     * @param attrName name of attribute
186
     * @return value of attribute
187
     */
188
    Object getAttribute(FileProxy file, String attrName);
189
190
    /** Allows versioning system to exclude some children from recursive
191
     * listening check. Also notifies the versioning whenever a refresh
192
     * is required and allows the versiniong to provide special timestamp
193
     * for a directory.
194
     * <p>
195
     * Default implementation of this method returns -1.
196
     *
197
     * @param dir the directory to check timestamp for
198
     * @param lastTimeStamp the previously known timestamp or -1
199
     * @param children add subfiles that shall be interated into this array
200
     * @return the timestamp that shall represent this directory, it will
201
     *   be compared with timestamps of all children and the newest
202
     *   one will be kept and next time passed as lastTimeStamp. Return
203
     *   0 if the directory does not have any special timestamp. Return
204
     *   -1 if you are not providing any special implementation
205
     */
206
    long refreshRecursively(FileProxy dir, long lastTimeStamp, List<? super FileProxy> children);
207
}
(-)a/masterfs/nbproject/project.xml (+2 lines)
Lines 135-140 Link Here
135
                </test-type>
135
                </test-type>
136
            </test-dependencies>
136
            </test-dependencies>
137
            <friend-packages>
137
            <friend-packages>
138
                <friend>org.netbeans.modules.dlight.remote.impl</friend>
139
                <friend>org.netbeans.modules.fsbridge</friend>
138
                <friend>org.netbeans.modules.javafx.source</friend>
140
                <friend>org.netbeans.modules.javafx.source</friend>
139
                <friend>org.netbeans.modules.parsing.api</friend>
141
                <friend>org.netbeans.modules.parsing.api</friend>
140
                <friend>org.netbeans.modules.parsing.lucene</friend>
142
                <friend>org.netbeans.modules.parsing.lucene</friend>
(-)a/nbbuild/cluster.properties (+1 lines)
Lines 269-274 Link Here
269
        extbrowser,\
269
        extbrowser,\
270
        extexecution,\
270
        extexecution,\
271
        extexecution.destroy,\
271
        extexecution.destroy,\
272
        fsbridge,\
272
        glassfish.common,\
273
        glassfish.common,\
273
        gototest,\
274
        gototest,\
274
        gsf.codecoverage,\
275
        gsf.codecoverage,\
(-)a/versioning/nbproject/project.xml (+8 lines)
Lines 94-99 Link Here
94
                    </run-dependency>
94
                    </run-dependency>
95
                </dependency>
95
                </dependency>
96
                <dependency>
96
                <dependency>
97
                    <code-name-base>org.netbeans.modules.fsbridge</code-name-base>
98
                    <build-prerequisite/>
99
                    <compile-dependency/>
100
                    <run-dependency>
101
                        <specification-version>1.0</specification-version>
102
                    </run-dependency>
103
                </dependency>
104
                <dependency>
97
                    <code-name-base>org.netbeans.modules.masterfs</code-name-base>
105
                    <code-name-base>org.netbeans.modules.masterfs</code-name-base>
98
                    <build-prerequisite/>
106
                    <build-prerequisite/>
99
                    <compile-dependency/>
107
                    <compile-dependency/>

Return to bug 199806