Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write a file into unix folder from windows folder using java

 
kalees waran
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to copy a file from Windows folder to unix folder using Java

I need a FTP utility.

The file is processed by a Java program and the file has to be written to Unix folder

I have the unix server name and folder name.

Can anyone please help me how to do it?
 
Tim Cooke
Sheriff
Posts: 3300
153
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, and welcome to the Ranch!

Why do you need a Java program to do this? Why not just use an FTP client? Or SCP/SFTP if you need it encrypted on the wire?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Apache Commons Net library has everything you need to write an FTP client.
 
kalees waran
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my file in Java program from where it needs to be written to unix server
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If by "folder" you mean an FTP directory, then that library will work for you. If you actually mean a shared directory, then a library like jCIFS would be needed instead (assuming that it *is* a drive accessed via SMB).
 
kalees waran
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will have to write my CSV file alone to Unix server's particular folder.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The contents of what you need to write make no difference. But you need to be certain how to access the server - is it via FTP or via shared directory?
 
kalees waran
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FTP only
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you're all set with Commons Net.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!