mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Remove SSH Service dependency on UI. Update Manifest. Polish About.
This commit is contained in:
parent
e3f0ff096d
commit
9a4a39a9ed
9 changed files with 42 additions and 33 deletions
|
@ -1,17 +1,14 @@
|
||||||
Manifest-Version: 1.0
|
Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %plugin.name
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.rse.services.ssh;singleton:=true
|
Bundle-SymbolicName: org.eclipse.rse.services.ssh;singleton:=true
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.0.0.qualifier
|
||||||
Bundle-Activator: org.eclipse.rse.services.ssh.Activator
|
Bundle-Activator: org.eclipse.rse.services.ssh.Activator
|
||||||
Bundle-Vendor: Eclipse.org
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
org.eclipse.core.runtime,
|
|
||||||
org.eclipse.rse.services,
|
org.eclipse.rse.services,
|
||||||
com.jcraft.jsch,
|
com.jcraft.jsch;bundle-version="[0.1.28,2.0.0)"
|
||||||
org.eclipse.team.cvs.ui,
|
|
||||||
org.eclipse.team.cvs.ssh2
|
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
Export-Package: org.eclipse.rse.services.ssh,
|
Export-Package: org.eclipse.rse.services.ssh,
|
||||||
org.eclipse.rse.services.ssh.files,
|
org.eclipse.rse.services.ssh.files,
|
||||||
|
|
|
@ -24,5 +24,9 @@ provided with the Content. If no such license exists, contact the Redistributor
|
||||||
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
|
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
|
||||||
and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
|
and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
|
||||||
|
|
||||||
|
<h2>Trademarks</h2>
|
||||||
|
<p>SSH is a registered trademark and Secure Shell is a trademark of
|
||||||
|
SSH Communications Security Corp (<a href="http://www.ssh.com">http://www.ssh.com</a>)</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
bin.includes = about.html,\
|
bin.includes = META-INF/,\
|
||||||
icons/,\
|
.,\
|
||||||
META-INF/,\
|
about.html,\
|
||||||
plugin.properties,\
|
|
||||||
plugin.xml,\
|
|
||||||
readme.txt,\
|
|
||||||
about.ini,\
|
about.ini,\
|
||||||
about.mappings,\
|
about.mappings,\
|
||||||
about.properties,\
|
about.properties,\
|
||||||
|
plugin.properties,\
|
||||||
|
readme.txt,\
|
||||||
eclipse32.gif
|
eclipse32.gif
|
||||||
src.includes = readme.txt
|
src.includes = readme.txt
|
||||||
jars.compile.order = .
|
jars.compile.order = .
|
||||||
|
|
|
@ -9,4 +9,6 @@
|
||||||
# Martin Oberhuber - initial API and implementation
|
# Martin Oberhuber - initial API and implementation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
plugin.name = RSE SSH Services
|
pluginName = RSE SSH Services
|
||||||
|
providerName = Eclipse.org
|
||||||
|
|
|
@ -11,15 +11,14 @@
|
||||||
|
|
||||||
package org.eclipse.rse.services.ssh;
|
package org.eclipse.rse.services.ssh;
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.core.runtime.Plugin;
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main plugin class to be used in the desktop.
|
* The main plugin class to be used in the desktop.
|
||||||
*/
|
*/
|
||||||
public class Activator extends AbstractUIPlugin {
|
public class Activator extends Plugin {
|
||||||
|
|
||||||
//The shared instance.
|
//The shared instance.
|
||||||
private static Activator plugin;
|
private static Activator plugin;
|
||||||
|
@ -28,6 +27,7 @@ public class Activator extends AbstractUIPlugin {
|
||||||
* The constructor.
|
* The constructor.
|
||||||
*/
|
*/
|
||||||
public Activator() {
|
public Activator() {
|
||||||
|
super();
|
||||||
plugin = this;
|
plugin = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,15 +56,4 @@ public class Activator extends AbstractUIPlugin {
|
||||||
public static Activator getDefault() {
|
public static Activator getDefault() {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an image descriptor for the image file at the given
|
|
||||||
* plug-in relative path.
|
|
||||||
*
|
|
||||||
* @param path the path
|
|
||||||
* @return the image descriptor
|
|
||||||
*/
|
|
||||||
public static ImageDescriptor getImageDescriptor(String path) {
|
|
||||||
return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.services.ssh", path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,11 +133,21 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
||||||
return (IHostFile[])results.toArray(new IHostFile[results.size()]);
|
return (IHostFile[])results.toArray(new IHostFile[results.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SftpHostFile makeHostFile(String parentPath, String fileName, SftpATTRS attrs) {
|
private SftpHostFile makeHostFile(String parentPath, String fileName, SftpATTRS attrs) {
|
||||||
SftpHostFile node = new SftpHostFile(parentPath, fileName, attrs.isDir(), false, attrs.isLink(), attrs.getMTime(), attrs.getSize());
|
SftpHostFile node = new SftpHostFile(parentPath, fileName, attrs.isDir(), false, attrs.isLink(), attrs.getMTime(), attrs.getSize());
|
||||||
if (attrs.getExtended()!=null) {
|
if (attrs.getExtended()!=null) {
|
||||||
node.setExtendedData(attrs.getExtended());
|
node.setExtendedData(attrs.getExtended());
|
||||||
}
|
}
|
||||||
|
//TODO remove comments as soon as jsch-0.1.29 is available
|
||||||
|
//if (node.isLink()) {
|
||||||
|
// try {
|
||||||
|
// //Note: readlink() is supported only with jsch-0.1.29 or higher.
|
||||||
|
// //By catching the exception we remain backward compatible.
|
||||||
|
// String linkTarget=fChannelSftp.readlink(node.getAbsolutePath());
|
||||||
|
// node.setLinkTarget(linkTarget);
|
||||||
|
// //TODO: Classify the type of resource linked to as file, folder or broken link
|
||||||
|
// } catch(Exception e) {}
|
||||||
|
//}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ public class SftpHostFile implements IHostFile {
|
||||||
private long fLastModified = 0;
|
private long fLastModified = 0;
|
||||||
private long fSize = 0;
|
private long fSize = 0;
|
||||||
private boolean fIsLink = false;
|
private boolean fIsLink = false;
|
||||||
|
private String fLinkTarget;
|
||||||
private String[] fExtended = null;
|
private String[] fExtended = null;
|
||||||
|
|
||||||
//TODO just re-use or extend FTPHostFile instead of copying here?
|
//TODO just re-use or extend FTPHostFile instead of copying here?
|
||||||
|
@ -126,6 +127,14 @@ public class SftpHostFile implements IHostFile {
|
||||||
return fIsLink;
|
return fIsLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLinkTarget(String linkTarget) {
|
||||||
|
fLinkTarget = linkTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLinkTarget() {
|
||||||
|
return fLinkTarget;
|
||||||
|
}
|
||||||
|
|
||||||
/** Extended data: name:value pairs */
|
/** Extended data: name:value pairs */
|
||||||
public void setExtendedData(String[] extended) {
|
public void setExtendedData(String[] extended) {
|
||||||
fExtended = extended;
|
fExtended = extended;
|
||||||
|
@ -141,6 +150,9 @@ public class SftpHostFile implements IHostFile {
|
||||||
if (isLink()) {
|
if (isLink()) {
|
||||||
//TODO: read symbolic link target and its type to provide e.g. "symbolic link(directory):/export4/opt
|
//TODO: read symbolic link target and its type to provide e.g. "symbolic link(directory):/export4/opt
|
||||||
result = "symbolic link"; //$NON-NLS-1$
|
result = "symbolic link"; //$NON-NLS-1$
|
||||||
|
if (fLinkTarget!=null) {
|
||||||
|
result += "(unknown):" + fLinkTarget; //$NON-NLS-1$
|
||||||
|
}
|
||||||
} else if (isFile()) {
|
} else if (isFile()) {
|
||||||
result = "file"; //$NON-NLS-1$
|
result = "file"; //$NON-NLS-1$
|
||||||
} else if (isDirectory()) {
|
} else if (isDirectory()) {
|
||||||
|
|
|
@ -20,13 +20,11 @@ import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
|
||||||
import org.eclipse.rse.services.shells.AbstractHostShell;
|
import org.eclipse.rse.services.shells.AbstractHostShell;
|
||||||
import org.eclipse.rse.services.shells.IHostShellOutputReader;
|
import org.eclipse.rse.services.shells.IHostShellOutputReader;
|
||||||
import org.eclipse.rse.services.ssh.ISshSessionProvider;
|
import org.eclipse.rse.services.ssh.ISshSessionProvider;
|
||||||
|
|
||||||
import com.jcraft.jsch.Channel;
|
import com.jcraft.jsch.Channel;
|
||||||
import com.jcraft.jsch.Session;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Shell subsystem for SSH.
|
* A Shell subsystem for SSH.
|
||||||
|
|
|
@ -23,8 +23,6 @@ import org.eclipse.rse.services.shells.IShellService;
|
||||||
import org.eclipse.rse.services.ssh.ISshService;
|
import org.eclipse.rse.services.ssh.ISshService;
|
||||||
import org.eclipse.rse.services.ssh.ISshSessionProvider;
|
import org.eclipse.rse.services.ssh.ISshSessionProvider;
|
||||||
|
|
||||||
import com.jcraft.jsch.Session;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Shell Services for ssh.
|
* A Shell Services for ssh.
|
||||||
* Adapted from LocalShellService.
|
* Adapted from LocalShellService.
|
||||||
|
|
Loading…
Add table
Reference in a new issue