Solved

FTP / Batch File

Posted on 2002-06-18
4
313 Views
Last Modified: 2010-08-05
I am looking for a way to FTP using Java(need to perform mget as well as get) and a way to launch a batch file using Java.  Does anyone have working code that works and does this?  Thanks.
0
Comment
Question by:sladej
4 Comments
 
LVL 9

Accepted Solution

by:
Venci75 earned 100 total points
ID: 7087678
try the sun.net.ftp.FtpClient class
0
 
LVL 5

Expert Comment

by:Calron
ID: 7092587
For starting a batch file you can use the same technique that was answered in the following question:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20008904
0
 
LVL 1

Expert Comment

by:laax
ID: 7121426
Hi
   You can use the ftp service available on your local/server machine using the -s option of ftp application.

   i.e you can pass a text file containing your ftp commands and pass it to ftp application using the -s option.

   Ex.  ftp -s:MyCommands.txt

   In Java: Runtime.getRuntime().exec("ftp -s:MyCommands.txt");

   Depending on your requirement use a static text file or create the file dynamically.

Laax.
0
 

Expert Comment

by:jscape
ID: 9752524
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groovy example issue 10 90
JAVA part two 5 58
JList custom Cell Renderer refresh 15 53
Java SE 8u111  Lot of stuff broke 11 54
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now