public void putString(byte[] foo, int begin, int length) { putInt(length); putByte(foo, begin, length); } public void putInt(int val) {
public void putString(byte[] foo, int begin, int length) { putInt(length); putByte(foo, begin, length); } public void putInt(int val) {
public void putString(byte[] foo, int begin, int length) { putInt(length); putByte(foo, begin, length); } public void putInt(int val) {
private void sendOPEN(byte[] path, int mode) throws Exception{ packet.reset(); putHEAD(SSH_FXP_OPEN, 17+path.length); buf.putInt(seq++); buf.putString(path); buf.putInt(mode); buf.putInt(0); // attrs getSession().write(packet, this, 17+path.length+4); } private void sendPacketPath(byte fxp, byte[] path) throws Exception{
private void sendMKDIR(byte[] path, SftpATTRS attr) throws Exception{ packet.reset(); putHEAD(SSH_FXP_MKDIR, 9+path.length+(attr!=null?attr.length():4)); buf.putInt(seq++); buf.putString(path); // path if(attr!=null) attr.dump(buf); else buf.putInt(0); getSession().write(packet, this, 9+path.length+(attr!=null?attr.length():4)+4); } private void sendRMDIR(byte[] path) throws Exception{
private void sendMKDIR(byte[] path, SftpATTRS attr) throws Exception{ packet.reset(); putHEAD(SSH_FXP_MKDIR, 9+path.length+(attr!=null?attr.length():4)); buf.putInt(seq++); buf.putString(path); // path if(attr!=null) attr.dump(buf); else buf.putInt(0); getSession().write(packet, this, 9+path.length+(attr!=null?attr.length():4)+4); } private void sendRMDIR(byte[] path) throws Exception{
private void sendPacketPath(byte fxp, byte[] path) throws Exception{ packet.reset(); putHEAD(fxp, 9+path.length); buf.putInt(seq++); buf.putString(path); // path getSession().write(packet, this, 9+path.length+4); } private void sendPacketPath(byte fxp, byte[] p1, byte[] p2) throws Exception{
private void sendSETSTAT(byte[] path, SftpATTRS attr) throws Exception{ packet.reset(); putHEAD(SSH_FXP_SETSTAT, 9+path.length+attr.length()); buf.putInt(seq++); buf.putString(path); // path attr.dump(buf); getSession().write(packet, this, 9+path.length+attr.length()+4); } private void sendREMOVE(byte[] path) throws Exception{
private void sendSETSTAT(byte[] path, SftpATTRS attr) throws Exception { packet.reset(); putHEAD(SSH_FXP_SETSTAT, 9 + path.length + attr.length()); buf.putInt(seq++); buf.putString(path); attr.dump(buf); getSession().write(packet, this, 9 + path.length + attr.length() + 4); }
private void sendSETSTAT(byte[] path, SftpATTRS attr) throws Exception{ packet.reset(); putHEAD(SSH_FXP_SETSTAT, 9+path.length+attr.length()); buf.putInt(seq++); buf.putString(path); // path attr.dump(buf); getSession().write(packet, this, 9+path.length+attr.length()+4); } private void sendREMOVE(byte[] path) throws Exception{
private void sendSETSTAT(byte[] path, SftpATTRS attr) throws Exception{ packet.reset(); putHEAD(SSH_FXP_SETSTAT, 9+path.length+attr.length()); buf.putInt(seq++); buf.putString(path); // path attr.dump(buf); getSession().write(packet, this, 9+path.length+attr.length()+4); } private void sendREMOVE(byte[] path) throws Exception{
private void sendSETSTAT(byte[] path, SftpATTRS attr) throws Exception{ packet.reset(); putHEAD(SSH_FXP_SETSTAT, 9+path.length+attr.length()); buf.putInt(seq++); buf.putString(path); // path attr.dump(buf); getSession().write(packet, this, 9+path.length+attr.length()+4); } private void sendREMOVE(byte[] path) throws Exception{