Package org.apache.cxf.tools.util

Examples of org.apache.cxf.tools.util.FileWriterUtil


                outputDir = outputDir + "/";
            }
        } else {
            outputDir = "./";
        }
        FileWriterUtil fw = new FileWriterUtil(outputDir);
        try {
            writer = fw.getWriter("", newName);
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, env.get(ToolConstants.CFG_OUTPUTDIR)
                                    + System.getProperty("file.seperator") + newName);
            throw new ToolException(msg, ioe);
        }
View Full Code Here


    @Before
    public void setUp() throws Exception {
        super.setUp();

        gen = new DummyGenerator();
        util = new FileWriterUtil(output.toString());

        context = new ToolContext();
        context.put(ToolConstants.CFG_OUTPUTDIR, output.toString());
        gen.setEnvironment(context);
View Full Code Here

    public Writer getOutputWriter(String filename, String outputDirectory) throws Exception {

       
        if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
            String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();           
            return new FileWriterUtil()
                .getWriter(new File(outputDirectory, filename), encoding);
        } else {
            FileWriterUtil fw = new FileWriterUtil(outputDirectory, null);       
            return fw.getWriter("", filename);
        }      
    }
View Full Code Here

    }

    public Writer getOutputWriter(File file) throws Exception {       
        if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
            String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();           
            return new FileWriterUtil().getWriter(file, encoding);
        } else {
            return new FileWriterUtil().getWriter(file, "UTF-8");
        }      
    }   
View Full Code Here

                outputDir = outputDir + "/";
            }
        } else {
            outputDir = "./";
        }
        FileWriterUtil fw = new FileWriterUtil(outputDir);
        try {
            writer = fw.getWriter("", newName);
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, env.get(ToolConstants.CFG_OUTPUTDIR)
                                    + System.getProperty("file.seperator") + newName);
            throw new ToolException(msg, ioe);
        }
View Full Code Here

                outputDir = outputDir + "/";
            }
        } else {
            outputDir = "./";
        }
        FileWriterUtil fw = new FileWriterUtil(outputDir);
        try {
            writer = fw.getWriter("", newName);
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_WRITE_FILE",
                                      LOG,
                                      env.get(ToolConstants.CFG_OUTPUTDIR)
                                      + System.getProperty("file.seperator")
View Full Code Here

                outputDir = outputDir + "/";
            }
        } else {
            outputDir = "./";
        }
        FileWriterUtil fw = new FileWriterUtil(outputDir);
        try {
            writer = fw.getWriter("", newName);
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, env.get(ToolConstants.CFG_OUTPUTDIR)
                                    + System.getProperty("file.seperator") + newName);
            throw new ToolException(msg, ioe);
        }
View Full Code Here

       
        if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
            String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();           
            return FileWriterUtil.getWriter(new File(outputDirectory, filename), encoding);
        } else {
            FileWriterUtil fw = new FileWriterUtil(outputDirectory);       
            return fw.getWriter("", filename);
        }      
    }
View Full Code Here

    protected boolean isCollision(String packageName, String filename, String ext) throws ToolException {
        if (env.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
            return false;
        }
        FileWriterUtil fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
        return fw.isCollision(packageName, filename + ext);
    }
View Full Code Here

    protected boolean wantToKeep() {
        return env.optionSet(ToolConstants.CFG_GEN_NEW_ONLY);
    }

    protected Writer parseOutputName(String packageName, String filename, String ext) throws ToolException {
        FileWriterUtil fw = null;
        Writer writer = null;

        if (wantToKeep() && isCollision(packageName, filename, ext)) {
            Message msg = new Message("SKIP_GEN", LOG, packageName + "." + filename + ext);
            LOG.log(Level.INFO, msg.toString());
            return null;
        }

        fw = new FileWriterUtil(getOutputDir());
        try {
            writer = fw.getWriter(packageName, filename + ext);
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, packageName + "." + filename + ext);
            throw new ToolException(msg, ioe);
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.util.FileWriterUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.