Solved

FTP / Batch File

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Arrays.asList  VS  ArrayList 4 56
iterator/ListIterator approach 17 26
runtime exception 2 28
Adding multiple JVM environments to RedHat 6 7 20
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

776 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