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
5
votes
1 answer

Apache VFS resolveFile with regex

If I have a directory called temp with the following files: a_file1.jpg a_file2.jpg b_file1.jpg b_file2.jpg It's possible to get all files like this: VFS.getManager().resolveFile("temp").getChildren(); But, what I actually want to do is get…
Mark Pope
  • 11,244
  • 10
  • 49
  • 59
5
votes
2 answers

Too many connections with apache commons-vfs2

I have an application that needs to download files from sftp. I'm currently using apache commons-vfs2 I have a scheduler that runs every 1 minute. 1. Get the list of files that's on remote (open connection, get the list, then close connection) 2.…
user311633
  • 173
  • 3
  • 11
5
votes
1 answer

How to set KEX on JSch Session when using Apache VFS

I am using Apache VFS 2.1 with JSch 0.1.54 (latest versions today) to upload files using SFTP. The system throws "End of IO Stream Read" when connecting, the complete stack is: Caused by: com.jcraft.jsch.JSchException: Session.connect:…
Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165
5
votes
2 answers

Java SFTP (apache vfs2) - password with @

I'm trying to use the org.apache.commons.vfs2 to download a file via SFTP. The problem is, the password contains the '@' char, so this causes the URI to be parsed incorrectly: org.apache.commons.vfs2.FileSystemException: Expecting / to follow the…
Ayelet
  • 1,713
  • 9
  • 29
  • 43
5
votes
2 answers

Hello world example on VFS: create a zip file from scratch

I would like to create a zip file with Commons VFS2 library. I know how to copy a file when using file prefix but for zip files write and read are not implemented. fileSystemManager.resolveFile("path comes here")-method fails when I try path…
mico
  • 12,730
  • 12
  • 59
  • 99
4
votes
1 answer

Android - Installing Apache Commons VFS - Issues

I'm hoping to use the Apache Commons VFS library in my Android project and have downloaded the relevant files from http://commons.apache.org/vfs/download_vfs.cgi. However. I'm getting some issues. I've copied the commons-vfs2-2.0.jar file into a…
Michael
  • 575
  • 1
  • 6
  • 15
4
votes
3 answers

Apache VFS error. because it is a relative path, and no base URI was provided

I'm building a service using Spring boot. I need to list files from SFTP and download the matched file. I'm using org.apache.commons, commons-vfs2 - version 2.4 Previously, my code worked normally. It can iterate through the directly to download my…
Hikaru Shindo
  • 2,611
  • 8
  • 34
  • 59
4
votes
2 answers

Apache Commons VFS - How does one set the size of a file...?

I can't seem to find any method on FileObject or FileContent which allows me to set a new size on an existing file. FileContent.getSize() does not have a corresponding setSize(). RandomAccessContent does have some comments about seeking but it does…
mP.
  • 18,002
  • 10
  • 71
  • 105
4
votes
2 answers

Cannot rename file using apache commons vfs for vsftpd in ubuntu 18.04

I am trying to rename the file in vsftpd server using apache commons vfs, moveTo function is working fine in local system OS (Kubuntu 19.04) and VSFTPD server but when I try to rename the file in a test environment which has ubuntu 18.04 I am not…
pise
  • 849
  • 6
  • 24
  • 51
4
votes
1 answer

Why Apache VFS (SFTP) tries to switch to root directory even when not needed And how to avoid it

I am using apache VFS for uploading files to sftp server. But one sftp server has a limitation that it's root directory doesn't have any permission. But the directory which is allowed for my application is let's say "/ftp/abc/". This directory is…
Aqeel Ashiq
  • 1,988
  • 5
  • 24
  • 57
4
votes
2 answers

Apache commons VFS unknown scheme file

I've even went to google page #5, but no answer... I have the following included (I've check the war and it is also…
TungstenX
  • 830
  • 3
  • 19
  • 40
4
votes
0 answers

Implementation of java.nio.FileSystem wrapping Commons VFS?

I know there exists Apache Commons VFS which permits to connect to different FileSystem, where a FileSystem may be something like a FTP, HTTP, SFTP, Zip file or simply a local file system. I am wondering, after some search (most on Google and VFS…
NoDataFound
  • 11,381
  • 33
  • 59
4
votes
2 answers

Apache VFS in-memory

I just found VFS as a way to access sftp. Seems to work but all the examples assume a local file; instead I have my data in memory. I only see a method copyFrom(FileObject), no overloads accepting a stream or a buffer... So I tried ram as it sounds…
B W
  • 41
  • 1
  • 3
4
votes
1 answer

How to check if FileObject is folder?

I'm using Apache Commons VFS (Virtual File System) to access some files over SFTP. Does anybody know how to check if an instance of org.apache.commons.vfs.FileContent is folder?
Boris Pavlović
  • 63,078
  • 28
  • 122
  • 148
3
votes
1 answer

Commons vfs findFiles imaginary file

In my quartz job I want to read csv files from directory using commons-vfs. try { FileSystemManager fsManager = VFS.getManager(); final FileObject fileObject = fsManager.resolveFile(getJob().getDirectory()); if(fileObject.getType() !=…
alephx
  • 4,908
  • 1
  • 17
  • 12
1
2
3
10 11