Questions tagged [apache-commons-vfs]

Apache Commons VFS provides a single API for accessing various different file systems.

Apache Commons VFS provides a single API for accessing various different file systems. It presents a uniform view of the files from various different sources, such as the files on local disk, on an HTTP server, or inside a Zip archive.

156 questions
21
votes
1 answer

SFTP Upload Download Exist and Move using Apache Commons VFS

I need a pure Apache Commons VFS solution/code/example for Uploading a local file to Remote Host Location Check if a File exists in Remote Host Location Downloading a Remote Host File to Local file location Move a file from one Remote Location to…
Ashok Goli
  • 5,043
  • 8
  • 38
  • 68
16
votes
5 answers

Commons VFS and Java.net.URL - Adding support for "sftp://" protocol

We're trying to use Apache Commons VFS to access something over SFTP. It claims to support SFTP, however we're getting a MalformedURLException when it starts. Digging around I see that apache vfs is using java.net.URL. However the documentation…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
11
votes
3 answers

Apache VFS2 - can't upload file to SFTP server

I'm trying to use Apache VFS2 to upload files to SFTP server. SFTP works OK when using client like WinSCP. I took some examples found in the internet to use the java client, but I'm keep getting errors. The version used is 2.3. The code: public…
Seffy
  • 1,045
  • 1
  • 13
  • 27
11
votes
3 answers

Convert a FileObject into a File

I'm using Apache Commons VFS2 (Virtual File System) to monitor change file in directory. org.apache.commons.vfs2.FileListener return org.apache.commons.vfs2.FileObject. How Convert a org.apache.commons.vfs2.FileObject into a java.io.File
Gleb Belyaev
  • 1,009
  • 1
  • 14
  • 23
10
votes
1 answer

How to list files directory/files using Apache Common vfs

i am new using Apache Common vfs, I success connect to the server I already read docs but i'm stuck in this code. How i can list directory/files? .... Session session = null; FileSystemManager fsManager = null; FileSystem fs =…
fanjavaid
  • 1,676
  • 8
  • 34
  • 65
9
votes
2 answers

"Expecting / to follow the hostname in URI" exception when password contains @

I am trying to copy local system file to server package classes; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.util.Properties; import org.apache.commons.vfs.FileObject; import…
Karan Patel
  • 91
  • 1
  • 4
9
votes
2 answers

Apache Commons VFS thread safety and resource management

I'm looking into using Apache Commons VFS for a project that will need to transfer files between local server and remote servers via ftp, sftp and https. The standard usage examples are getting the FileSystemManager from a static…
Jimmy Praet
  • 2,230
  • 1
  • 15
  • 14
8
votes
4 answers

Commons VFS - Cannot list the contents of a directory

I have a problem with Commons VFS. I want to connect to a directory using SFTP and list it. Here is the code: FileSystemOptions opts = new FileSystemOptions(); SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts,…
user219882
  • 15,274
  • 23
  • 93
  • 138
7
votes
5 answers

Apache Commons VFS - cannot resolveFile

The VFS method cannot process this URI ${jboss.server.temp.dir}/local/outgoing configured in jboss-beans.xml which is resolved to "C:\\Download\\jboss-eap-5.1.1\\server\\default\\tmp/local/outgoing" by JBoss. When I try to resolve the URI and get…
user219882
  • 15,274
  • 23
  • 93
  • 138
7
votes
2 answers

How to use apache vfs2 for sftp with public-private-key and without password

Currently I am using apache vfs2 to download files from a sftp. For authentication I use user-name and password. Is there a way to use vfs2 only with public-private-keys and without a password? I think I have use this function,but how? Set it only…
LStrike
  • 1,598
  • 4
  • 26
  • 58
7
votes
3 answers

File upload to SFTP fails (Apache VFS)

I have a problem with a SFTP (Windows with WinSSHD). I try to write a file in a folder with Apache Commons VFS. On a local SFTP I have no problem with the upload but on a second SFTP I always get the error below. The FTP looks like this: I need to…
Darkpara
  • 304
  • 1
  • 2
  • 14
6
votes
4 answers

JDBC Oracle wallet based connection: Wallet folder in memory

I want to connect to an Oracle database using a wallet stored in memory instead of having the wallet stored on disk. I tried using Apache Common VFS to read/write files in memory. The wallet is written to memory (to be sure I even wrote the wallet…
Nabila
  • 191
  • 4
  • 19
6
votes
1 answer

VFS2 Error cannot delete file and could not get the groups id of the current user (error code: -1)

I'm using VFS2 to take and import files into the folders by SFTP protocol. But I'm obtaining an Error. Picture below my code: Into the log for all files I'm watching this error: The error sequence is: 1) cannot delete file 2) Could not determine…
Stefano
  • 1,439
  • 4
  • 23
  • 38
6
votes
1 answer

How does the Commons VFS Cache works?

I'm trying to learn how to use Apache Commons VFS2. I've read all the docu I could find and I'm already kind of familiar with the API but still there is one thing that isn't perfectly clear to me. How does the Cache mechanism work? In particular: I…
mdzh
  • 1,030
  • 2
  • 17
  • 34
6
votes
2 answers

How do I use JCIFS with apache VFS to access an SMB URL?

I am trying to access a folder on my local computer using an smb URL. my project is using the jars: commons-vfs2-2.0.jar and jcifs-1.3.17.jar (and all the other required jars). The code in it's entirety is: public static void main(String[] args)…
Michael Omer
  • 71
  • 1
  • 3
1
2 3
10 11