updating ssh tools to java 1.5
Bernardo F Costa <[email protected]>
| Newsgroups | gmane.comp.java.sshtools.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I tried to install ssh-tools from source with java
1.6, and I have found it has a little uncompatibility
with recent versions of java, perhaps java 1.5 and
above. So I made this small patch file to make it
compatible with recent versions of java.
---
src/com/sshtools/common/ui/SessionProviderFactory.java
2003-12-08 10:54:40.000000000 -0200
+++
src/com/sshtools/common/ui/SessionProviderFactory.java
2006-12-24 09:18:53.603339512 -0200
@@ -88,7 +88,7 @@
ExtensionClassLoader classloader =
ConfigurationLoader.getExtensionClassLoader();
try {
- Enumeration enum =
classloader.getResources("session.provider");
+ Enumeration en =
classloader.getResources("session.provider");
URL url = null;
Properties properties;
InputStream in;
@@ -96,9 +96,9 @@
String name;
String id;
- while (enum.hasMoreElements()) {
+ while (en.hasMoreElements()) {
try {
- url = (URL) enum.nextElement();
+ url = (URL) en.nextElement();
in = url.openStream();
properties = new Properties();
properties.load(in);
---
src/com/sshtools/common/ui/SshToolsApplicationPanel.java
2003-12-08 10:54:40.000000000 -0200
+++
src/com/sshtools/common/ui/SshToolsApplicationPanel.java
2006-12-24 09:27:29.618893224 -0200
@@ -636,7 +636,7 @@
java.lang.reflect.Method method =
exception.getClass()
.getMethod("getCause",
new Class[] { });
- Throwable cause = (Throwable)
method.invoke(exception, null);
+ Throwable cause = (Throwable)
method.invoke(exception, (java.lang.Object) null);
if (cause != null) {
appendException(cause, level + 1,
buf, details);
---
src/com/sshtools/daemon/session/SessionChannelServer.java
2003-12-08 10:54:44.000000000 -0200
+++
src/com/sshtools/daemon/session/SessionChannelServer.java
2006-12-24 09:32:35.077456464 -0200
@@ -123,7 +123,7 @@
// If we have a process monitor then get the
exit code
// and send before we close the channel
if (processMonitor != null) {
- StartStopState state =
processMonitor.getState();
+ StartStopState state =
processMonitor.getProcessMonitorState();
try {
state.waitForState(StartStopState.STOPPED);
@@ -561,7 +561,7 @@
state = subsystem.getState();
}
- public StartStopState getState() {
+ public StartStopState
getProcessMonitorState() {
return state;
}
---
src/com/sshtools/j2ssh/transport/cipher/SshCipherFactory.java
2003-12-08 10:54:50.000000000 -0200
+++
src/com/sshtools/j2ssh/transport/cipher/SshCipherFactory.java
2006-12-24 09:19:19.787358936 -0200
@@ -70,14 +70,14 @@
defaultCipher = "blowfish-cbc";
try {
- Enumeration enum =
ConfigurationLoader.getExtensionClassLoader()
+ Enumeration en =
ConfigurationLoader.getExtensionClassLoader()
.getResources("j2ssh.cipher");
URL url;
Properties properties = new Properties();
InputStream in;
- while ((enum != null) &&
enum.hasMoreElements()) {
- url = (URL) enum.nextElement();
+ while ((en != null) &&
en.hasMoreElements()) {
+ url = (URL) en.nextElement();
in = url.openStream();
properties.load(in);
IOUtil.closeStream(in);
---
src/com/sshtools/j2ssh/transport/compression/SshCompressionFactory.java
2003-12-08 10:54:50.000000000 -0200
+++
src/com/sshtools/j2ssh/transport/compression/SshCompressionFactory.java
2006-12-24 09:20:14.571030552 -0200
@@ -71,14 +71,14 @@
defaultAlgorithm = COMP_NONE;
try {
- Enumeration enum =
ConfigurationLoader.getExtensionClassLoader()
+ Enumeration en =
ConfigurationLoader.getExtensionClassLoader()
.getResources("j2ssh.compression");
URL url;
Properties properties = new Properties();
InputStream in;
- while ((enum != null) &&
enum.hasMoreElements()) {
- url = (URL) enum.nextElement();
+ while ((en != null) &&
en.hasMoreElements()) {
+ url = (URL) en.nextElement();
in = url.openStream();
properties.load(in);
IOUtil.closeStream(in);
---
src/com/sshtools/j2ssh/transport/publickey/SshPrivateKeyFormatFactory.java
2003-12-08 10:54:52.000000000 -0200
+++
src/com/sshtools/j2ssh/transport/publickey/SshPrivateKeyFormatFactory.java
2006-12-24 09:20:43.902571480 -0200
@@ -71,14 +71,14 @@
defaultFormat =
"SSHTools-PrivateKey-Base64Encoded";
try {
- Enumeration enum =
ConfigurationLoader.getExtensionClassLoader()
+ Enumeration en =
ConfigurationLoader.getExtensionClassLoader()
.getResources("j2ssh.privatekey");
URL url;
Properties properties = new Properties();
InputStream in;
- while ((enum != null) &&
enum.hasMoreElements()) {
- url = (URL) enum.nextElement();
+ while ((en != null) &&
en.hasMoreElements()) {
+ url = (URL) en.nextElement();
in = url.openStream();
properties.load(in);
IOUtil.closeStream(in);
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sshtools-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sshtools-users
patch.txt
(text/plain, 5.3 KB)
--- src/com/sshtools/common/ui/SessionProviderFactory.java 2003-12-08 10:54:40.000000000 -0200
+++ src/com/sshtools/common/ui/SessionProviderFactory.java 2006-12-24 09:18:53.603339512 -0200
@@ -88,7 +88,7 @@
ExtensionClassLoader classloader = ConfigurationLoader.getExtensionClassLoader();
try {
- Enumeration enum = classloader.getResources("session.provider");
+ Enumeration en = classloader.getResources("session.provider");
URL url = null;
Properties properties;
InputStream in;
@@ -96,9 +96,9 @@
String name;
String id;
- while (enum.hasMoreElements()) {
+ while (en.hasMoreElements()) {
try {
- url = (URL) enum.nextElement();
+ url = (URL) en.nextElement();
in = url.openStream();
properties = new Properties();
properties.load(in);
--- src/com/sshtools/common/ui/SshToolsApplicationPanel.java 2003-12-08 10:54:40.000000000 -0200
+++ src/com/sshtools/common/ui/SshToolsApplicationPanel.java 2006-12-24 09:27:29.618893224 -0200
@@ -636,7 +636,7 @@
java.lang.reflect.Method method = exception.getClass()
.getMethod("getCause",
new Class[] { });
- Throwable cause = (Throwable) method.invoke(exception, null);
+ Throwable cause = (Throwable) method.invoke(exception, (java.lang.Object) null);
if (cause != null) {
appendException(cause, level + 1, buf, details);
--- src/com/sshtools/daemon/session/SessionChannelServer.java 2003-12-08 10:54:44.000000000 -0200
+++ src/com/sshtools/daemon/session/SessionChannelServer.java 2006-12-24 09:32:35.077456464 -0200
@@ -123,7 +123,7 @@
// If we have a process monitor then get the exit code
// and send before we close the channel
if (processMonitor != null) {
- StartStopState state = processMonitor.getState();
+ StartStopState state = processMonitor.getProcessMonitorState();
try {
state.waitForState(StartStopState.STOPPED);
@@ -561,7 +561,7 @@
state = subsystem.getState();
}
- public StartStopState getState() {
+ public StartStopState getProcessMonitorState() {
return state;
}
--- src/com/sshtools/j2ssh/transport/cipher/SshCipherFactory.java 2003-12-08 10:54:50.000000000 -0200
+++ src/com/sshtools/j2ssh/transport/cipher/SshCipherFactory.java 2006-12-24 09:19:19.787358936 -0200
@@ -70,14 +70,14 @@
defaultCipher = "blowfish-cbc";
try {
- Enumeration enum = ConfigurationLoader.getExtensionClassLoader()
+ Enumeration en = ConfigurationLoader.getExtensionClassLoader()
.getResources("j2ssh.cipher");
URL url;
Properties properties = new Properties();
InputStream in;
- while ((enum != null) && enum.hasMoreElements()) {
- url = (URL) enum.nextElement();
+ while ((en != null) && en.hasMoreElements()) {
+ url = (URL) en.nextElement();
in = url.openStream();
properties.load(in);
IOUtil.closeStream(in);
--- src/com/sshtools/j2ssh/transport/compression/SshCompressionFactory.java 2003-12-08 10:54:50.000000000 -0200
+++ src/com/sshtools/j2ssh/transport/compression/SshCompressionFactory.java 2006-12-24 09:20:14.571030552 -0200
@@ -71,14 +71,14 @@
defaultAlgorithm = COMP_NONE;
try {
- Enumeration enum = ConfigurationLoader.getExtensionClassLoader()
+ Enumeration en = ConfigurationLoader.getExtensionClassLoader()
.getResources("j2ssh.compression");
URL url;
Properties properties = new Properties();
InputStream in;
- while ((enum != null) && enum.hasMoreElements()) {
- url = (URL) enum.nextElement();
+ while ((en != null) && en.hasMoreElements()) {
+ url = (URL) en.nextElement();
in = url.openStream();
properties.load(in);
IOUtil.closeStream(in);
--- src/com/sshtools/j2ssh/transport/publickey/SshPrivateKeyFormatFactory.java 2003-12-08 10:54:52.000000000 -0200
+++ src/com/sshtools/j2ssh/transport/publickey/SshPrivateKeyFormatFactory.java 2006-12-24 09:20:43.902571480 -0200
@@ -71,14 +71,14 @@
defaultFormat = "SSHTools-PrivateKey-Base64Encoded";
try {
- Enumeration enum = ConfigurationLoader.getExtensionClassLoader()
+ Enumeration en = ConfigurationLoader.getExtensionClassLoader()
.getResources("j2ssh.privatekey");
URL url;
Properties properties = new Properties();
InputStream in;
- while ((enum != null) && enum.hasMoreElements()) {
- url = (URL) enum.nextElement();
+ while ((en != null) && en.hasMoreElements()) {
+ url = (URL) en.nextElement();
in = url.openStream();
properties.load(in);
IOUtil.closeStream(in);