org.nutz.lang.Files Java Examples

The following examples show how to use org.nutz.lang.Files. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Generator.java    From web-flash with MIT License 5 votes vote down vote up
public void generate(String packageName, String templatePath, File file, boolean force)
        throws IOException {
    if (file.exists() && !force) {
        log.debug("file " + file + " exists, skipped");
        return;
    }

    String code = generateCode(packageName, templatePath);
    file.getParentFile().mkdirs();
    Files.write(file, code.getBytes(Charset.forName("utf8")));

}
 
Example #2
Source File: Generator.java    From flash-waimai with MIT License 5 votes vote down vote up
public void generate(String packageName, String templatePath, File file, boolean force)
        throws IOException {
    if (file.exists() && !force) {
        log.debug("file " + file + " exists, skipped");
        return;
    }

    String code = generateCode(packageName, templatePath);
    file.getParentFile().mkdirs();
    Files.write(file, code.getBytes(Charset.forName("utf8")));

}