*Pages 1--3 from  Microsoft Word - code.doc*
 dddd 
 while( 
 rsReturn.  next() 


 ) 
 { 


 String 
 ls_  dir_ 
 name 
 = 
 rsReturn.  getString( 


 1); 


 String 
 ls_  filename 


 = 
 rsReturn.  getString( 


 2); 


 byte[] 
 document_  store 


 = 
 rsReturn.  getBytes( 


 3); 


 try 
 {dddd  doFtp( 


 ls_  filename, 


 ls_  dir_ 
 name, 
 document_  store); 


 } 
 catch 


 (Exception 


 e) 
 { 


 System.  out. 
 println(  Error 


 in 
 ftp 


  
 + 
 e); 


 } 
 ddd 
 } 


 dddd  public 
 void 
 doFtp(  String 


 file, 
 String 


 dir, 
 document_  store) 


 throws 
 Exception 


 { 
 String 


 root 
 = 
 /  www/ 


 pub/  Edocs_ 


 test/  Daily_ 


 Business/  2002/; 


 if 
 (ftp 


 == 
 null) 


 { 


 try 
 { 
 ftpConnect(  root);  }  catch  (Exception 


 e) 
 { 


 throw 
 new 
 Exception(  Connection 


 to 
 infoserver 


 cccc 


 } 
 }  try 
 { 
 ftp.  setDirectory( 


 root 
 + 
 dir 


 + 
 /);  dddd 


 } 
 catch 


 (Exception 


 e) 
 { 


 try 
 { 
 ftp.  setDirectory( 


 root); 
 ftp.  makeDirectory( 


 dir); 
 ftp.  setDirectory( 
 root 
 + 
 dir 


 + 
 /); 


 } 
 catch 


 (Exception 


 ex) 
 { 


 throw 
 new 
 Exception 


 (  Could 
 not 
 create 


 new 
 directory 


  
 + 
 dir 


 + 
 ftp 


 failed); 


 } 
 dddd 


 Deleted: 
 byte[] 
 Deleted: 
 failed); 
1
 dddddddd  } 
2
 try 
 { 
 ftp.  putBinaryFile( 


 file, 
 document_  store); 


 } 
 catch 


 (Exception 


 ex) 
 { 


 throw 
 new 
 Exception 


 (  Could 
 not 
 write 


 to 
 infoserver 


 ftp 
 failed); 


 } 
 }  private 


 void 
 ftpConnect(  String 


 root) 
 throws 


 Exception 


 { 
 ftp 
 = 
 new 


 FtpBean();  ftp.  ftpConnect("  aigsun01w", 


 "ssriniva", 
 "monday1"); 


 System.  out. 
 println("  Directory 


 " 
 + 
 ftp.  getDirectory()); 


 } 
3