How about something like this:
protected void sendAbsoluteName(int id, File file) throws IOException {
Buffer buffer = new Buffer();
buffer.putByte((byte) SSH_FXP_NAME);
buffer.putInt(id);
buffer.putInt(1);
String path = file.getPath();
if(File.separatorChar != '/') {
path = path.replace(File.separatorChar, '/');
}
if(path.charAt(0) != '/') {
path = '/' + path;
}
buffer.putString(path);
//buffer.putString(file.getPath());
writeAttrs(buffer, file);
send(buffer);
}
Regards,
Sai Pullabhotla
On Wed, May 5, 2010 at 8:45 AM, Sai Pullabhotla
<[email protected]> wrote:
> I removed the second call to place the path in the buffer and seems to
> be working fine.
>
> Regards,
> Sai Pullabhotla
>