Solved

FTP / Batch File

Posted on 2002-06-18
4
311 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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:

744 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

13 Experts available now in Live!

Get 1:1 Help Now