Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uploadAllDataToServer is throwing error #17

Open
GoogleCodeExporter opened this issue Mar 8, 2016 · 1 comment
Open

uploadAllDataToServer is throwing error #17

GoogleCodeExporter opened this issue Mar 8, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. create obj for ConnBean
ConnBean cb = new ConnBean(hostname,username,password)
2. SSHExec.getInstance(cb);
   SSHExec ssh = SSHExec.getInstance(cb);
   ssh.connect();
3. ssh.uploadAllDataToServer(localdir,   destination);

What is the expected output? What do you see instead?
Expected output: it should be upload all file to destination location.
Instead of this it is throwing error with exception:
java.lang.ArrayIndexOutOfBoundsException: 1
    at net.neoremind.sshxcute.core.SSHExec.traverseDataDir(SSHExec.java:523)
    at net.neoremind.sshxcute.core.SSHExec.traverseDataDir(SSHExec.java:518)
    at net.neoremind.sshxcute.core.SSHExec.uploadAllDataToServer(SSHExec.java:265)

What version of the product are you using? On what operating system?
I am using sshxcute1.0 and os is win7 64 bit

Please provide any additional information below.

Original issue reported on code.google.com by i.ramandas on 29 Aug 2013 at 3:43

@GoogleCodeExporter
Copy link
Author

I've found a fix for this.  SSHExec.java at the very bottom is a function 
called traverseDataDir().  The problem occurs when a file it's picked up is on 
the parent directory you passed into the uploadAllDataToServer.  There's a 
split function that returns an array of size 0 because the 2 parameters are 
equivalent.  
You can correct it by making an If else around it:
if(parentDir.getParent().toString().replace('\\', '/').equals(parentRootPath))
{               dataList.put(parentDir.getPath().toString().replace('\\', '/'),"");
}
else{
//Do original code
}
}

Original comment by kmal...@fenwayx.com on 20 Jan 2015 at 6:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant