Author: bfoster
Date: Thu Jun 9 19:09:04 2011
New Revision: 1134043
URL: http://svn.apache.org/viewvc?rev=1134043&view=rev
Log:
- cleanup
---------------
OODT-194
Modified:
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java
Modified:
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java
URL:
http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java?rev=1134043&r1=1134042&r2=1134043&view=diff
==============================================================================
---
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java
(original)
+++
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java
Thu Jun 9 19:09:04 2011
@@ -80,7 +80,8 @@ public class TestJschSftpProtocol extend
public void testCDandPWDandLS() throws IOException, ProtocolException {
JschSftpProtocol sftpProtocol = new JschSftpProtocol(2022);
- sftpProtocol.connect("localhost", new
HostKeyAuthentication("bfoster", "", new
File("src/testdata/sample-dsa.pub").getAbsoluteFile().getAbsolutePath()));
+ sftpProtocol.connect("localhost", new
HostKeyAuthentication("bfoster", "",
+ new
File("src/testdata/sample-dsa.pub").getAbsoluteFile().getAbsolutePath()));
ProtocolFile homeDir = sftpProtocol.pwd();
ProtocolFile testDir = new ProtocolFile(homeDir, "sshTestDir",
true);
sftpProtocol.cd(testDir);
Modified:
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java
URL:
http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java?rev=1134043&r1=1134042&r2=1134043&view=diff
==============================================================================
---
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java
(original)
+++
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java
Thu Jun 9 19:09:04 2011
@@ -27,87 +27,88 @@ import com.sshtools.daemon.platform.Nati
import com.sshtools.j2ssh.io.DynamicBuffer;
/**
- * This is a shell provider that prints a message saying that
- * we don't support shell access, and then closes the connection.
+ * This is a shell provider that prints a message saying that we don't support
+ * shell access, and then closes the connection.
*/
-public final class UnsupportedShellProcessProvider extends
NativeProcessProvider {
+public final class UnsupportedShellProcessProvider extends
+ NativeProcessProvider {
- private static final String MESSAGE = "This server does not provide
shell access, only SFTP. Goodbye.\n";
+ private static final String MESSAGE = "This server does not provide
shell access, only SFTP. Goodbye.\n";
- private DynamicBuffer stdin = new DynamicBuffer();
- private DynamicBuffer stderr = new DynamicBuffer();
- private DynamicBuffer stdout = new DynamicBuffer();
-
- @Override
- public boolean createProcess(final String command, final Map
environment)
- throws IOException {
- return true;
- }
-
- @Override
- public String getDefaultTerminalProvider() {
- return "UnsupportedShell";
- }
-
- @Override
- public void kill() {
- try {
- stdin.getInputStream().close();
- stdin.getOutputStream().close();
- } catch (Exception ex) {
- }
- try {
- stdout.getInputStream().close();
- stdout.getOutputStream().close();
- } catch (Exception ex1) {
- }
- try {
- stderr.getInputStream().close();
- stderr.getOutputStream().close();
- } catch (Exception ex2) {
- }
- }
-
- @Override
- public void start() throws IOException {
- stdin.getOutputStream().write(MESSAGE.getBytes());
- }
-
- @Override
- public boolean stillActive() {
- try {
- return stdin.getInputStream().available() > 0;
- } catch (IOException ex) {
- return false;
- }
- }
-
- @Override
- public boolean supportsPseudoTerminal(final String term) {
- return true;
- }
-
- @Override
- public boolean allocatePseudoTerminal(final String term, final int
cols, final int rows,
- final int width, final int height, final String modes)
{
- return true;
- }
-
- @Override
- public int waitForExitCode() {
- return 0;
- }
-
- public InputStream getInputStream() throws IOException {
- return stdin.getInputStream();
- }
-
- public OutputStream getOutputStream() throws IOException {
- return stdout.getOutputStream();
- }
-
- public InputStream getStderrInputStream() {
- return stderr.getInputStream();
- }
+ private DynamicBuffer stdin = new DynamicBuffer();
+ private DynamicBuffer stderr = new DynamicBuffer();
+ private DynamicBuffer stdout = new DynamicBuffer();
+
+ @Override
+ public boolean createProcess(final String command, final Map
environment)
+ throws IOException {
+ return true;
+ }
+
+ @Override
+ public String getDefaultTerminalProvider() {
+ return "UnsupportedShell";
+ }
+
+ @Override
+ public void kill() {
+ try {
+ stdin.getInputStream().close();
+ stdin.getOutputStream().close();
+ } catch (Exception ex) {
+ }
+ try {
+ stdout.getInputStream().close();
+ stdout.getOutputStream().close();
+ } catch (Exception ex1) {
+ }
+ try {
+ stderr.getInputStream().close();
+ stderr.getOutputStream().close();
+ } catch (Exception ex2) {
+ }
+ }
+
+ @Override
+ public void start() throws IOException {
+ stdin.getOutputStream().write(MESSAGE.getBytes());
+ }
+
+ @Override
+ public boolean stillActive() {
+ try {
+ return stdin.getInputStream().available() > 0;
+ } catch (IOException ex) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean supportsPseudoTerminal(final String term) {
+ return true;
+ }
+
+ @Override
+ public boolean allocatePseudoTerminal(final String term, final int cols,
+ final int rows, final int width, final int height,
final String modes) {
+ return true;
+ }
+
+ @Override
+ public int waitForExitCode() {
+ return 0;
+ }
+
+ public InputStream getInputStream() throws IOException {
+ return stdin.getInputStream();
+ }
+
+ public OutputStream getOutputStream() throws IOException {
+ return stdout.getOutputStream();
+ }
+
+ public InputStream getStderrInputStream() {
+ return stderr.getInputStream();
+ }
}