You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Nolan, Edell" <Ed...@iona.com> on 2007/05/02 11:46:49 UTC

Proposed change to getWriter(...) in FileWriterUtil class

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");
    }

RE: Proposed change to getWriter(...) in FileWriterUtil class

Posted by "Nolan, Edell" <Ed...@iona.com>.
Hi,

Thanks - in the process of doing that.

Thanks, Edell. 

-----Original Message-----
From: Dan Diephouse [mailto:dan@envoisolutions.com] 
Sent: 04 May 2007 11:28
To: cxf-dev@incubator.apache.org
Subject: Re: Proposed change to getWriter(...) in FileWriterUtil class

I suppose that would be fine. Can you create a patch and submit it via
JIRA?

- Dan

On 5/2/07, Nolan, Edell <Ed...@iona.com> wrote:
>
> 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");
>     }
>



--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: Proposed change to getWriter(...) in FileWriterUtil class

Posted by Dan Diephouse <da...@envoisolutions.com>.
I suppose that would be fine. Can you create a patch and submit it via JIRA?

- Dan

On 5/2/07, Nolan, Edell <Ed...@iona.com> wrote:
>
> 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");
>     }
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog