• Post Reply Bookmark Topic Watch Topic
  • New Topic

copy file to ssh server from windows in java using vfs  RSS feed

 
Prabes Suwal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a program to copy a file to SSH linux server. But when i run this program "could not copy... path doesn't exist". But there is a file in that path in server. My code could not locate the path.




ANd the error is:
May 03, 2017 11:31:58 AM org.apache.commons.vfs2.VfsLog info
INFO: Using "C:\Users\ADMINI~1\AppData\Local\Temp\vfs_cache" as temporary files store.
path: sftp://ntech:123456@192.168.1.250:2010/usr/tomcat/webapps/newfolder/aaa.txt
org.apache.commons.vfs2.FileSystemException: Could not copy "sftp://ntech:***@192.168.1.250:2010/usr/tomcat/webapps/newfolder/url.txt" because it does not exist.
at org.apache.commons.vfs2.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:1015)
at np.com.ntech.aaa.bbb.GetMyFiles.startFTP(GetMyFiles.java:78)
at np.com.ntech.aaa.bbb.GetMyFiles.main(GetMyFiles.java:32)




Please help me in this. Thanks in advance.

 
Julian Isaac
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try

SftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, false);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!