Downloading and uploading files without ftp and sftp - java

I want to get download and upload from a remote windows machine(workgroup,or domain) to my local unix machine.I dont want to use Sftp or FTP server.I also consider the Jcifs(smb) librariy but it only allowing access to shared directories.I want to access any directory with sufficent user permission.How can i do this I think active directory has a capability.

I would just open up a samba share on your unix machine and connect to the share from your windows machine.

Related

Is there a way to upload file to EFS from local system using java?

I am new to AWS EFS and trying to understand how EFS file upload works.
Is there a way to upload files to EFS from local machine programmatically using java?
EFS is only accessible from within a VPC. You can't access it directly from outside of AWS. So you would have to setup a VPN connection between home network and your VPC, and then mount EFS filesystem in your local computer.
AWS EFS is a managed NFS service. Copying files from a local (on-premise) machine would require to mount it through a VPN connection or AWS Direct Connect. There is a guide for this here.
Once this is done, you can access it just like any other mounted file system, either with Java or otherwise.

Access FTP files from java without filezilla or winscp

I have made java web application for uploading file in ftp and in the same application user can directly open files in browser. It is running successfully when Filezilla or winscp is opened. After closing filezilla and winscp I can't access or upload files to ftp. Is there any possible solution, that I can access these files from web application without installing external application. I'm using Apache commons.net library for ftp connection.
There is JSch that is a library to access sftp in Java. I have used it before in a project and is relatively straight forward. Probably you will have to work on it to open files in a web application though.
http://www.jcraft.com/jsch/examples/Sftp.java.html

how to allow file uploading using ssh on ubuntu from java code?

I am trying to upload files to an amazon EC2 virtual machine running Ubuntu. I use the JSch library for SSH connection as in
here
Connection through SSH succeeds but when I try to upload the file, I get "Permission Denied" error.
I use keys to log in to the EC2 instance.
The question is how to set the permissions on Ubuntu to allow the file upload?
This seems more like a linux / filesystem question, if I understand you correctly. Copy-paste your exact error, please.
Where on your EC2 instance are you trying to put the file? SSH to your EC2 instance using the same user as the SFTP user you've specified in your Java code, cd to the target directory and check ownership and permissions with ls -l. Try to create a file there touch mytestfile. Do you get any permission errors at this point?
Alternative:
What kind of file is this? Does it change a lot? Do the writes/reads have to be faster than HTTP? A better "cloud design pattern" would be to upload your file to an S3 bucket and give your EC2 instance read(&write?) permissions to that bucket/file.

Java Establish connection to a network computer

I have a program that needs to read/write files to/from a network computer. Sometimes however the program cannot access the folder on the network computer. Currently, to fix this issue, I go into windows explorer's network section, click the computer, enter my credentials, and then my program is able to read and write to this computer without a problem. Is there a way to allow Java to ask for these credentials or a way to automatically send these credentials using java? I am using Win7 and Win7 embedded on the network computer.
You can use http://jcifs.samba.org/ which is a library for accessing remote CIFS shares. This allows you to set username and password and works on any platform (not just windows) It works without needing to mount a drive.

download remote machine files using java

I would like to download somefiles which is in remote shared folder from the local system using java code. Can you please guide us, how i can proceed this. Whether i need use http or ftp. But i want to execute the code only in the local machine. It should not like client server program. Please post some tips over here.
Thanks in advance.
You cannot solve this without knowing the platform of your machine (where the app runs) and remote machine. But once you know you have many possibilities.
Agent full solution
Install agent on remote machine. The agent should expose API that allows access to the files. For example you can use FTP server as an agent. Then access this server and download your files. Alternatively you can implement your own application or servlet running in one of available servlet containers and provide access to files over HTTP.
Agent-less solution
Use the built-in functionality of target machine. For example use SSH to connect to Unix machine and SMB for windows. Both support Telnet
You can use VFS package from jakarta. There are several implementations of SSH. I recommend JSH.

Categories