Max Maeder created VFS-773:
------------------------------
Summary: Could not find file with URI
"sftp://[email protected]:22/hi.html" because it is a relative path, and
no base URI was provided.
Key: VFS-773
URL: https://issues.apache.org/jira/browse/VFS-773
Project: Commons VFS
Issue Type: Bug
Affects Versions: 2.6.0
Environment: Google Cloud Engine instance with default firewall
settings
Reporter: Max Maeder
I've been pulling my hair out over this issue, I've searched the interwebs and
this issue tracker for someone having a similar issue, but to no avail.
Every time I run the following code, I get this error:
{code:java}
org.apache.commons.vfs2.FileSystemException: Could not find file with URI
"sftp://[email protected]:22/hi.html" because it is a relative path, and
no base URI was provided.
[01:58:12] [Thread-14/WARN]: at
org.apache.commons.vfs2.FileSystemException.requireNonNull(FileSystemException.java:87)
[01:58:12] [Thread-14/WARN]: at
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:734)
[01:58:12] [Thread-14/WARN]: at
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:683)
[01:58:12] [Thread-14/WARN]: at
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:638)
[01:58:12] [Thread-14/WARN]: at
ratismal.drivebackup.ftp.SFTPUploader.uploadFile(SFTPUploader.java:55)
[01:58:12] [Thread-14/WARN]: at
ratismal.drivebackup.ftp.FTPUploader.uploadFile(FTPUploader.java:37)
[01:58:12] [Thread-14/WARN]: at
ratismal.drivebackup.UploadThread.run(UploadThread.java:96)
[01:58:12] [Thread-14/WARN]: at
java.base/java.lang.Thread.run(Thread.java:834)
{code}
{code:java}
package ratismal.drivebackup.ftp;
import org.apache.commons.vfs2.FileObject;import
org.apache.commons.vfs2.FileSystemManager;import org.apache.commons.vfs2.VFS;
import ratismal.drivebackup.config.Config;import
ratismal.drivebackup.util.MessageUtil;
import java.io.File;import java.util.*;
public class SFTPUploader {
public static void uploadFile() throws Exception { FileSystemManager
manager = VFS.getManager();
FileObject remoteFolder =
manager.resolveFile("sftp://[email protected]:22/hi.html");
remoteFolder.close(); }}
{code}
I'm sorry if this is the wrong place to ask.
Also, the credentials above aren't going to get you into my server ;)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)