/Users/lyon/j4p/src/net/ftp/GetAndStoreThread.java

1    package net.ftp; 
2     
3     
4    public class GetAndStoreThread 
5        implements Runnable { 
6      Thread thread; 
7      String fileName; 
8      String directory; 
9      String hostName; 
10     String userName; 
11     String password; 
12    
13     public void run() { 
14       FTPCommands.getFileAndStore( 
15           fileName, directory, 
16           hostName, 
17           userName, password); 
18     } 
19    
20     public static void main(String args[]) { 
21       String fileName = "readme"; 
22       String directory = "/incoming/"; 
23       String hostName = "vinny.bridgeport.edu"; 
24       String userName = "ftpin"; 
25       String password = "ftpin"; 
26       new GetAndStoreThread( 
27           fileName, 
28           directory, 
29           hostName, 
30           userName, 
31           password); 
32     } 
33    
34     public GetAndStoreThread( 
35         String _fileName, String _directory, 
36         String _hostName, String _userName, 
37         String _password) { 
38       String fileName = _fileName; 
39       String directory = _directory; 
40       String hostName = _hostName; 
41       String userName = _userName; 
42       String password = _password; 
43       thread = new Thread(this); 
44       thread.start(); 
45     } 
46   }