Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > FTP Progress Bar

Reply
Thread Tools

FTP Progress Bar

 
 
stinehelferw
Guest
Posts: n/a
 
      12-07-2005
Using net commons.
Created a GUI FTP program similar to WS_FTP.
All working well, but interested in adding progress bar.

Looking at using a second thread to monitor the progress and report back to
main.

Here's the portion of program using ftp.retreivefile and FileOutputStream.

leftButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e16) {
// Retreive file(s) from remote system

// Find name of selected file for download in JLIST
String filename = remotefileList.getSelectedValue().toString();
String[] splitArray = null;
splitArray = filename.split(" ");
int i;
File destination = currentDir;

try {
messageTextArea.append("\n" + "Retreive File:" +
splitArray[0].toString().trim());

filename = splitArray[0].toString().trim();

File path = new File( destination + File.separator + filename);

FileOutputStream fos = new FileOutputStream( path );
ftp.retrieveFile( filename, fos );

messageTextArea.append("\n" + ftp.getReplyString()+ "\n");

fos.close();

filenameArray = currentDir.list();

locallistModel.clear();
locallistModel.addElement("[..]");
for(i=0;i<filenameArray.length;i++)
{
locallistModel.addElement(filenameArray[i]);
}
}
catch(FileNotFoundException e) { }
catch(IOException e) { }
}});


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress bar in web-based ftp? CatDude Python 1 05-09-2006 07:36 PM
[jakarta][FTP] progress bar transfert =?iso-8859-1?q?St=E9phane_KLEIN?= Java 1 10-05-2004 05:06 PM
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM
Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server. D. Buck Perl Misc 2 06-29-2004 02:05 PM
progress bar or guage bar Rob ASP General 6 07-12-2003 09:46 AM



Advertisments