apache-commons-vfs

Uploading to remote FTP server using Apache Commons VFS

流过昼夜 提交于 2020-06-12 20:35:08
问题 I'm attempting to upload a zipped file to a remote FTP server using Apache VFS. The environment in which this is being executed in is an AWS Java 8 Lambda if it's relevant. This is my current implementation which generally follows the example provided here: public static FileSystemOptions createDefaultOptions() throws FileSystemException { FileSystemOptions opts = new FileSystemOptions(); SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking( opts, "no");

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

岁酱吖の 提交于 2020-01-24 03:26:29
问题 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 if file 3) Caused by: com.jcraft.jsch.JSchException: Could not get the groups id of the current user (error code: -1) Properties folder: Could it dependens on the owner/groups ? 回答1: This is a known issue - see https://issues.apache.org/jira/browse

How to set KEX on JSch Session when using Apache VFS

十年热恋 提交于 2019-12-30 09:55:07
问题 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: java.io.IOException: End of IO Stream Read at com.jcraft.jsch.Session.connect(Session.java:565) at com.jcraft.jsch.Session.connect(Session.java:183) at org.apache.commons.vfs2.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:166) I've

vfs2 and samba(smb) version 2

偶尔善良 提交于 2019-12-24 07:34:48
问题 we disabled smbv1 in our windows machine and now we can't connect using smb2 we are using commons-vfs2(2.0) and commons-vfs2-sandbox(2.0) here is my code: @Test public void testConnection() throws FileSystemException { String folder = "\\\\10.0.0.0\\smb"; folder = folder.replaceAll("\\\\", "/"); StringBuilder builder = new StringBuilder(128).append(Protocol.CIFS.getProtocolPrefix()).append(':') .append(folder); String fileURI = builder.toString(); System.out.println(fileURI);

vfs2 and samba(smb) version 2

浪尽此生 提交于 2019-12-24 07:34:25
问题 we disabled smbv1 in our windows machine and now we can't connect using smb2 we are using commons-vfs2(2.0) and commons-vfs2-sandbox(2.0) here is my code: @Test public void testConnection() throws FileSystemException { String folder = "\\\\10.0.0.0\\smb"; folder = folder.replaceAll("\\\\", "/"); StringBuilder builder = new StringBuilder(128).append(Protocol.CIFS.getProtocolPrefix()).append(':') .append(folder); String fileURI = builder.toString(); System.out.println(fileURI);

SFTP Upload Download Exist and Move using Apache Commons VFS

心不动则不痛 提交于 2019-12-17 22:07:42
问题 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 another in the same Host Delete a file from the Remote Host Location via SFTP calls. The solution should only use Apache Commons VFS api and shouldn't refer to the underlying JSCH library. 回答1: The below SFTP Utility gives an example of Upload, Exist

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

不打扰是莪最后的温柔 提交于 2019-12-13 09:47:31
问题 I had the same problem: How do I use JCIFS with apache VFS to access an SMB URL? ... after including commons-vfs-sandbox-2.1-SNAPSHOT.jar in the classpath I now get this exception: Exception in thread "main" org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "smb://10.10.18.210/CIFS/123/asd". at org.apache.commons.vfs2.provider.AbstractFileObject.attach(AbstractFileObject.java:1522) at org.apache.commons.vfs2.provider.AbstractFileObject.getType

SFTP to a remote location without a password/key pair

北城以北 提交于 2019-12-11 12:21:32
问题 We are trying to provide an SFTP adapter in a Spring based environment to transfer files from local to either local or remote server.But, we dont have any password configured for the users in the remote location. All implementations like apache-commons VFS or Jsch require password or private key pairs to do file transfer. We cannot configure a password to the users now as that would need multiple changes in other APIs from which we get the user infromation. How do you suggest we tackle it?

How to find disk space of remote linux machine using Java [duplicate]

不问归期 提交于 2019-12-11 11:27:22
问题 This question already has answers here : How to find how much disk space is left using Java? (6 answers) Closed 5 years ago . I am looking for simple solution for finding total disk space and available space of a remove machine using java program. Please help Update There are questions already similar to this with primarily focus on local machine. I was looking solution for remote machine. 回答1: The easiest way to get the remote machine information and also safe way to do is to SSH to the