Upstream relative path and sFTP upload with apache.commons.vsf2

I try to upload files on remote server with sFTP protocol, I use apache.commons.vsf2 library, and it's works well.

Here is my code :

public void uploadFile(byte[] bytesArray, String target, String fileName) throws IOException {
        this.initProperties(); // initializes username, password and host 
        InputStream is = new ByteArrayInputStream(bytesArray);
        FileSystemManager manager = VFS.getManager();
        FileSystemOptions opts = new FileSystemOptions();
        FileObject remote = manager.resolveFile("sftp://" + username + ":" + password + "@" + host + "/" + fileName);
        try (OutputStream ostream = remote.getContent().getOutputStream()) {
            IOUtils.copy(is, ostream);
  "File {} uploaded", fileName);

But I want to change the default folder, and upload my files to an upstream folder, and I can't do it.

I tried with a relative path ("../"), but it seems that I don't have access to the parent directory, while I have access with mRemoteNg for example, with the same authentication (username / password).

For example, when I tried :

remote.getParent().getParent() // return null

An idea please ? Thanks

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum