From: Jacob P. <jpe...@us...> - 2006-12-06 08:15:37
|
Update of /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/servlet In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11681/src/java/org/compiere/ifm/app/servlet Modified Files: Tag: pbs_payment DownloadServlet.java Log Message: Index: DownloadServlet.java =================================================================== RCS file: /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/servlet/Attic/DownloadServlet.java,v retrieving revision 1.1.2.24 retrieving revision 1.1.2.25 diff -C2 -d -r1.1.2.24 -r1.1.2.25 *** DownloadServlet.java 21 Nov 2006 09:24:53 -0000 1.1.2.24 --- DownloadServlet.java 6 Dec 2006 08:15:31 -0000 1.1.2.25 *************** *** 9,14 **** --- 9,16 ---- import java.io.File; import java.io.FileInputStream; + import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; + import java.io.OutputStreamWriter; import java.io.RandomAccessFile; import java.io.UnsupportedEncodingException; *************** *** 486,498 **** try { ! //mgs+="\n -Processing contact: "+contact.getBothNames(); ! File file = new File(server_dir_path+"/"+contact.getIFM_Contacts_ID());//make file on server ! File to_file = new File(usr_dir_path+"/"+contact.getIFM_Contacts_ID());//copy server file to user home dir ! ! // Create a read-write memory-mapped file ! FileChannel rwChannel = new RandomAccessFile(file, "rw").getChannel(); ! ! // Create an output stream on the channel ! OutputStream os = Channels.newOutputStream(rwChannel); StringBuffer buf = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); --- 488,493 ---- try { ! ! StringBuffer buf = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); *************** *** 626,630 **** if(contact.getPrimaryLocation().getAddressline2()!=null) ! business_street=" "+contact.getPrimaryLocation().getAddressline2(); if(contact.getPrimaryLocation().getCity()!=null) --- 621,625 ---- if(contact.getPrimaryLocation().getAddressline2()!=null) ! business_street=business_street+" "+contact.getPrimaryLocation().getAddressline2(); if(contact.getPrimaryLocation().getCity()!=null) *************** *** 741,749 **** buf.append("</contact>"); ! os.write(buf.toString().getBytes()); ! os.flush(); ! os.close(); ! rwChannel.close(); //writing file is done, after copy to user home String str =IFM_Accces.copy(file,to_file);//uses kommand exe to copy files to user. if(str!=null && str.length()>0) --- 736,752 ---- buf.append("</contact>"); ! // Write the buffer to a textfile ! ! //mgs+="\n -Processing contact: "+contact.getBothNames(); ! File file = new File(server_dir_path+"/"+contact.getIFM_Contacts_ID());//make file on server ! File to_file = new File(usr_dir_path+"/"+contact.getIFM_Contacts_ID());//copy server file to user home dir ! + FileOutputStream fileOut = new FileOutputStream (file); + OutputStreamWriter outWriter = new OutputStreamWriter (fileOut, "UTF-8"); + outWriter.write(buf.toString()); + outWriter.close(); + + String str =IFM_Accces.copy(file,to_file);//uses kommand exe to copy files to user. if(str!=null && str.length()>0) |