Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FTP / Batch File

Posted on 2002-06-18
4
Medium Priority
?
321 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 300 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

722 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