Solved

FTP / Batch File

Posted on 2002-06-18
4
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

623 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