SSH URI error with Apache VFS



我在使用Apache VFS的Android应用程序中遇到以下错误,在谷歌上找不到太多帮助。我试图通过SSH上传一个文件,但我得到了这个相当模糊的错误。根据VFS文档,logcat中报告的URI在我看来是正确的。我唯一能想到的是,它只希望看到本地网络主机,而不是TLD。这是真的吗?如果是,我该如何解决?如果没有,您觉得这个URI有什么问题?

Caused by: org.apache.commons.vfs2.FileSystemException: Expecting / to follow the hostname in URI "sftp://username:***@mydomain.com/public_html/". 

无论是否有特定的目标文件名,错误都是相同的。

这是完整的logcat输出。

01-22 19:41:15.660: E/AndroidRuntime(1997): FATAL EXCEPTION: main
01-22 19:41:15.660: E/AndroidRuntime(1997): java.lang.RuntimeException: org.apache.commons.vfs2.FileSystemException: Invalid absolute URI "sftp://username:***@mysite.com/public_html/".
01-22 19:41:15.660: E/AndroidRuntime(1997):     at app.specialsauce.myapp.SiteEditor.upload(SiteEditor.java:279)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at app.specialsauce.myapp.SiteEditor.testSFTPSite(SiteEditor.java:289)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at app.specialsauce.myapp.SiteEditor$10.onClick(SiteEditor.java:629)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at android.view.View.performClick(View.java:2532)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at android.view.View$PerformClick.run(View.java:9293)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at android.os.Handler.handleCallback(Handler.java:587)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at android.os.Looper.loop(Looper.java:150)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at android.app.ActivityThread.main(ActivityThread.java:4263)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at java.lang.reflect.Method.invokeNative(Native Method)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at java.lang.reflect.Method.invoke(Method.java:507)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at dalvik.system.NativeStart.main(Native Method)
01-22 19:41:15.660: E/AndroidRuntime(1997): Caused by: org.apache.commons.vfs2.FileSystemException: Invalid absolute URI "sftp://username:***@mysite.com/public_html/".
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:61)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:693)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:621)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at app.specialsauce.myapp.SiteEditor.upload(SiteEditor.java:265)
01-22 19:41:15.660: E/AndroidRuntime(1997):     ... 13 more
01-22 19:41:15.660: E/AndroidRuntime(1997): Caused by: org.apache.commons.vfs2.FileSystemException: Expecting / to follow the hostname in URI "sftp://username:***@mysite.com/public_html/".
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.provider.HostFileNameParser.extractToPath(HostFileNameParser.java:155)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.provider.URLFileNameParser.parseUri(URLFileNameParser.java:50)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.provider.AbstractFileProvider.parseUri(AbstractFileProvider.java:188)
01-22 19:41:15.660: E/AndroidRuntime(1997):     at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:57)
01-22 19:41:15.660: E/AndroidRuntime(1997):     ... 16 more

我怀疑您的密码中有一个有问题的字符(因为这是唯一未显示的信息)。在将用户名和密码添加到URL之前,您需要对其进行百分比编码。

相关内容

  • 没有找到相关文章

最新更新