• Post Reply Bookmark Topic Watch Topic
  • New Topic

i want to copy Files in with in net work and using FTP

 
Jitendra Nayak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

this is in same network,i have username password for this network.

ex://10.x.x.x

shall this code is enough to copy:
if,Yes.how will i give path forthis machine?

problem 2:
==========

if i want to go for FTP what is the solution.
which API i need to use for FTP copy.



code:
====

java.io.FileInputStream inStream = new java.io.FileInputStream(source);
FileOutputStream outStream = new java.io.FileOutputStream(destination);

int len;
byte[] buf=new byte[2048];

while ((len=inStream.read(buf))!=-1)
{
outStream.write(buf,0,len);
retValue = true;
}
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use java.net.URL for FTP:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!