Package org.apache.cxf.tools.util

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


        return parseOutputName(packageName, filename, ".java");
    }

    public File parseOutputName(String packageName, String filename, String ext) throws ToolException {
        FileUtils.mkDir(new File(this.baseDir));
        FileWriterUtil fw = new FileWriterUtil(this.baseDir);
        try {
            return fw.getFileToWrite(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


                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

    String className = "Hello";

    @Test
    public void testKeep() throws Exception {
        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

    }

    @Test
    public void testOverwrite() throws Exception {
        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

       
        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

        return false;
    }

    public static void writeWSDL(Definition def, String outputdir, String wsdlOutput)
        throws WSDLException, IOException {
        FileWriterUtil fw = new FileWriterUtil(outputdir);
        Writer outputWriter = fw.getWriter("", wsdlOutput);

        writeWSDL(def, outputWriter);
    }
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

        return false;
    }

    public static void writeWSDL(Definition def, String outputdir, String wsdlOutput)
        throws WSDLException, IOException {
        FileWriterUtil fw = new FileWriterUtil(outputdir);
        Writer outputWriter = fw.getWriter("", wsdlOutput);

        writeWSDL(def, outputWriter);
    }
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) {
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message("FAIL_TO_WRITE_FILE",
                                                             LOG,
                                                             env.get(ToolConstants.CFG_OUTPUTDIR)
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.