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
1
vote
1 answer

How to fix error occurring while uploading file to SFTP server using Apache Commons VFS

Issue I am trying to upload file to SFTP server from remote desktop using Apache Commons VFS. The connection is established correctly, but while I am copying file to the server exception is threw: [24.10.…
Panicum
  • 794
  • 1
  • 9
  • 32
1
vote
1 answer

Use Apache Commons VFS RAM file to avoid using file system with API requiring a file

There is a highly upvoted comment on this post: how to create new java.io.File in memory? where Sorin Postelnicu mentions using an Apache Commons VFS RAM file as a way to have an in memory file to pass to an API that requires a java.io.File (I am…
chrismead
  • 2,163
  • 3
  • 24
  • 36
1
vote
0 answers

Change buffer size in VFS

I am using VFS for the file operation. While IO operation one the below method comes in the flow. class DefaultFileContent method public long write(final OutputStream output, final int bufferSize) throws IOException javadoc source code which writes…
mcacorner
  • 1,304
  • 3
  • 22
  • 45
1
vote
1 answer

Apache VFS2 reply timeout from the server

I am using VFS2 to upload file to remote hosts (FTP, SFTP) for my clients but sometimes i have to wait up to 5 minutes to get a timeout if connection is established but the server doesn't reply. E.g. apache vfs receives a connection from remote…
Yuriy Korovko
  • 515
  • 2
  • 9
  • 21
1
vote
1 answer

org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "sftp://username:***@114.XX.XX.XX/" on port 21

I could access SFTP from WinSCP using the below credentials serverAddress=114.XX.XX.XX userId=orafusion password=OraP!ss!123 remoteDirectory=TestData/ Port=21 Lib used: commons-vfs2-2.0.jar jsch-0.1.50.jar I get the below error when try…
Karthick.R
  • 33
  • 2
  • 8
1
vote
3 answers

Apache Commons VFS - How to open whatever dir follow by specific dir?

I think this is simple thing but some how I fail with it. I have this : ftp://user:password@host/Folder/Folder/Folder/../${Year}/${Month}/*.csv What I'm trying is to open whatever folder name follow by specific folder name. I'm try to access file…
1
vote
0 answers

How to get all files present from UNC path java?

Am try to get all files present in UNC path using apache commons-vfs2 library. But am not find way to list files present in UNC path with valid credentials.And then do manipulations in all files. I tried following code for access file present in…
Mister X
  • 3,406
  • 3
  • 31
  • 72
1
vote
2 answers

Copy from SFTP interrupted using Apache Commons VFS

I am trying to copy a file from an SFTP server using Apache Commons VFS Utility. While copying, if there is any type of network failure, it is expected that I will get an IOException. But I am unable to find any exception thrown (checked my logs).…
arnabkaycee
  • 1,634
  • 13
  • 26
1
vote
0 answers

file exists() false negative

I'm using commons-vfs 2.1 and it behaves strangely across different environments. I tested the same piece of code on different environment. And on one environment calling on exists() returns true and on the other returns false. The file is the same…
aclowkay
  • 3,577
  • 5
  • 35
  • 66
1
vote
1 answer

vfs2 - sftp File Corrupted During Download

I am using vfs2 to download file through sftp. .txt and .xml files are downloading correctly, but .pdf files are downloading corrupted. Below is my code: Does anyone see what I am doing wrong? import org.apache.commons.vfs2.*; public void…
Angelina
  • 2,175
  • 10
  • 42
  • 82
1
vote
0 answers

Apache Commons VFS2 doesn't release a lock after processing a zip file

Can you help me to find a way how to force the library to properly close files and allow other processes to further modified them.Currently when files are processed by the below code snippet they are kept by the application and cannot be modified. …
kamilx2
  • 191
  • 2
  • 6
1
vote
1 answer

Could not change to work directory "/" when calling FileSystemManager.resolveFile with FTP URL

I'm trying to put a file in a remote FTP host. This is how I usually do: String ftpUri = "ftp://" + target.get(server).get("Username") + ":{" + target.get(server).get("Psswd") + "}@"; if (StringUtils.isBlank(target.get(server).get("Port")))…
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
1
vote
1 answer

configure proxy for gradle-vfs plugin

tl;dr: How do I configure the https proxy to be used by the gradle-vfs plugin? It does seem to ignore the normal java/gradle proxy configuration. Full Details Based on this gradle file I try to use gradle to create reveal.js slides from asciidocs. I…
Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
1
vote
1 answer

Deleting zip file after accessing with apache commons vfs2 in Java

I'm trying to experiment with apache commons vfs2 to read content of a zip file as if it is just another directory. The zip files will ultimately hold all kinds of files (perhaps even a small database). For illustration purposes, I have created…
RonSiven
  • 939
  • 2
  • 10
  • 23
1
vote
0 answers

SFTP upload with Apache Commons VFS2 fails after consecutive transfers

I've created a class which uploads files to SFTP server using Apache Commons VFS2 and JSCH libraries. Everything works fine for the first (usually) 19 transfers but after that I'm starting to get exception SEVERE:…
Janne Rantala
  • 93
  • 1
  • 7