cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nolan, Edell" <Edell.No...@iona.com>
Subject Proposed change to getWriter(...) in FileWriterUtil class
Date Wed, 02 May 2007 09:46:49 GMT
Hi,
 
Is it possible that someone could add a new method or change the
existing one.
 
In the FileWriterUtil class in org.apache.cxf.tools.util;
 
In the getWriter(...) method - you assume that the encoding is always
UTF-8 - this may not always be the case.
 
In Yoko we want to be able to give the user an option to specify the
encoding they want.
 
So we could pass in the encoding here.
 
thanks, Edell.
 
 
public class FileWriterUtil {
    
        public Writer getWriter(String packageName, String fileName)
throws IOException {
        File dir = buildDir(packageName);
        File fn = new File(dir, fileName);
        if (fn.exists() && !fn.delete()) {
            throw new IOException(fn + ": Can't delete previous
version");
        }
        return new OutputStreamWriter(new BufferedOutputStream(new
FileOutputStream(fn)), "UTF-8");
    }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message