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
3
votes
0 answers

Null pointer exception in SFTP upload using Apache Commons VFS

I have code to use SFTP for uploading file to a remote server. I am using Kotlin/Java and Apache commons library. val manager = StandardFileSystemManager() manager.init() ... val tempFile: File = File ("/test.txt") I am following the example here .…
Bosco
  • 3,835
  • 6
  • 25
  • 33
3
votes
1 answer

Apache Commons VFS with Quercus

On an unmodified install, how can I configure Quercus so that PHP file functions use Apache Commons VFS to access files?
Bogdacutu
  • 763
  • 7
  • 24
3
votes
1 answer

Commons-vfs mocking up a filesystem

I'm trying to use commons-vfs as a filesystem wrapper in order to more easily unit test some code that needs to touch the filesystem. Right now I'm just getting familiar with the API. What I would like to do is create a virtual filesystem, and add a…
algernon
  • 149
  • 4
  • 14
3
votes
1 answer

Apache Commons VFS2 getUid() generates a NumberFormatException on connection to SFTP server

I am trying to download a file using apache-commons-vfs2 (V2.6.0) I can access the site using WinSCP so all the credentials are correct but I get a NumberFormatException error when I run the following Java program. I only want to download files…
JohnM
  • 31
  • 4
3
votes
2 answers

Apache Commons VFS: working with FTP

I'm trying to use Apache Commons VFS with FTP. On my FTP a have the next structure of files and folders: / /test /test/in /test/in/file1.txt /test/in/file2.txt I need to connect and read all files from folder /test/in (it changes all the time).…
ninja
  • 2,908
  • 4
  • 23
  • 30
3
votes
2 answers

Spring boot - throws exception jar does not exist

I am trying to create a jar through mvn package and then run through java -jar /target/test.jar Caused by: org.apache.commons.vfs2.FileSystemException: Could not replicate…
user1298426
  • 3,467
  • 15
  • 50
  • 96
3
votes
1 answer

Getting Special folders to work in Apache Commons VFS

The Apache Commons VFS library appears to be unable to support special Windows folders (Network, recent, computer, libraries, etc). File[] cbFolders = (File[])sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders"); and then converting them to…
Daniel Ryan
  • 6,976
  • 5
  • 45
  • 62
3
votes
0 answers

org.apache.commons.vfs2.FileSystemException: Could not create file

I want to access file remotely and I am using this code : FileObject destn=VFS.getManager().resolveFile(f.getAbsolutePath()); LOGGER.debug("Object Created" +destn); domain, username, password UserAuthenticator auth=new…
Varun Goyal
  • 43
  • 1
  • 6
3
votes
0 answers

org.apache.commons.vfs2.FileSystemException: Could not close the output stream

I am using VFS 2.0 for implementing SFTP for my application. I have a single Thread which actually picks up the file and do SFTP. 98% of the time it works. But I have observed there are few cases where SFTP is getting failed with below…
Arajit
  • 133
  • 3
  • 15
3
votes
2 answers

Is there a simple method to check if there are changes in a SFTP server?

My objective is to poll the SFTP server for changes. My first thought is to check if the number of files in the dir changed. Then maybe some additional checks for changes in the dir. Currently I'm using the following: try { FileSystemOptions…
iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169
3
votes
0 answers

Configuring Apache VFS using config files

I'm using Apache VFS and am configuring the SFTP file system programatically like this... SftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, true); I want to be able to easily swap in different providers and not have to write code…
Chris Pike
  • 272
  • 2
  • 10
3
votes
2 answers

Git protocol in Apache Commons VFS

Do you know about any implementation of git:// protocol for Apache Commons VFS in Java? Of course Git isn't among officially supported file systems, see http://commons.apache.org/proper/commons-vfs/filesystems.html — but I can't believe there is no…
dond
  • 138
  • 7
3
votes
1 answer

How do I return a response in an wso2 esb proxy with vfs JMS Sender?

I have a proxy service in WSO2 ESB 4.5.0 that is supposed to handle a SOAP-request from a webclient, send information to a JMS-topic and then respond to the the webclient. The problem is that when I use the JMS-sender it by default waits for a…
Tommy Ekh
  • 31
  • 4
3
votes
1 answer

Apache Commonfs VFS avoid growing temp dir

I have an issue with VFS. I developed a web application to paste a URL of a deploy package(zip file) into a textarea. You can view deploy scripts and at the end deploy the application. It runs on a tomcat on a small machine. The deploy packages are…
lrxw
  • 3,576
  • 7
  • 32
  • 46
2
votes
2 answers

Append to a file using Apache Commons VFS

I would like to use Apache Commons VFS to append text to a file if the file already exists and create a new file containing the text if the file does not exist. Looking at the Javadoc for VFS it appears that getOutputStream(boolean bAppend) method…
Paul H
  • 2,104
  • 7
  • 39
  • 53
1 2
3
10 11