From 1cec0114018172cb30aa0349d3bf623395c3cdc3 Mon Sep 17 00:00:00 2001 From: Shikhar Bhushan Date: Mon, 29 Aug 2011 16:21:10 +0100 Subject: [PATCH] chown / chmod / chgrp in StatefulSFTPClient -- these all delegate to setattr which is overriden in StatefulSFTPClient to do cwdification. #28 --- .../schmizz/sshj/sftp/StatefulSFTPClient.java | 38 +++++-------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/src/main/java/net/schmizz/sshj/sftp/StatefulSFTPClient.java b/src/main/java/net/schmizz/sshj/sftp/StatefulSFTPClient.java index 7f47d63f..48209b1c 100644 --- a/src/main/java/net/schmizz/sshj/sftp/StatefulSFTPClient.java +++ b/src/main/java/net/schmizz/sshj/sftp/StatefulSFTPClient.java @@ -15,13 +15,13 @@ */ package net.schmizz.sshj.sftp; +import net.schmizz.sshj.xfer.LocalDestFile; +import net.schmizz.sshj.xfer.LocalSourceFile; + import java.io.IOException; import java.util.List; import java.util.Set; -import net.schmizz.sshj.xfer.LocalDestFile; -import net.schmizz.sshj.xfer.LocalSourceFile; - public class StatefulSFTPClient extends SFTPClient { @@ -174,35 +174,17 @@ public class StatefulSFTPClient throws IOException { return super.canonicalize(cwdify(path)); } - - @Override - public void chown(String path, int uid) - throws IOException { - super.chown(cwdify(path), uid); - } - - @Override - public void chmod(String path, int perms) - throws IOException { - super.chmod(cwdify(path), perms); - } - - @Override - public void chgrp(String path, int gid) - throws IOException { - super.chgrp(cwdify(path), gid); - } @Override public void get(String source, String dest) throws IOException { super.get(cwdify(source), dest); } - + @Override public void get(String source, LocalDestFile dest) - throws IOException { - super.get(cwdify(source), dest); + throws IOException { + super.get(cwdify(source), dest); } @Override @@ -210,11 +192,11 @@ public class StatefulSFTPClient throws IOException { super.put(source, cwdify(dest)); } - + @Override public void put(LocalSourceFile source, String dest) - throws IOException { - super.put(source, cwdify(dest)); + throws IOException { + super.put(source, cwdify(dest)); } - + }