本文整理汇总了Java中org.databene.commons.IOUtil.writeTextFile方法的典型用法代码示例。如果您正苦于以下问题:Java IOUtil.writeTextFile方法的具体用法?Java IOUtil.writeTextFile怎么用?Java IOUtil.writeTextFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.databene.commons.IOUtil
的用法示例。
在下文中一共展示了IOUtil.writeTextFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBeneratorXml
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
public void createBeneratorXml() throws IOException, ParseException {
File descriptorFile = new File(setup.getProjectFolder(), "benerator.xml");
if (descriptorFile.exists()) { // not applicable for XML schema based generation
BufferedReader reader = IOUtil.getReaderForURI(descriptorFile.getAbsolutePath());
DefaultHTMLTokenizer tokenizer = new DefaultHTMLTokenizer(reader);
String lineSeparator = setup.getLineSeparator();
if (StringUtil.isEmpty(lineSeparator))
lineSeparator = SystemInfo.getLineSeparator();
LFNormalizingStringBuilder writer = new LFNormalizingStringBuilder(lineSeparator);
while (tokenizer.nextToken() != HTMLTokenizer.END)
processToken(setup, tokenizer, writer);
String xml = writer.toString();
xml = resolveVariables(xml);
IOUtil.writeTextFile(descriptorFile.getAbsolutePath(), xml, "UTF-8");
}
monitor.advance();
}
示例2: createOrOverwriteFile
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
private static File createOrOverwriteFile(String name, String content, boolean add, GitClient gitClient) throws IOException {
File file = file(name, gitClient);
IOUtil.writeTextFile(file.getAbsolutePath(), content);
if (add) {
gitClient.add(new AddData(name));
}
return file;
}
示例3: exit
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
@Override
public void exit() {
try {
String content = text.getText();
IOUtil.writeTextFile(BUFFER_FILE.getAbsolutePath(), content);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
System.exit(BeneratorConstants.EXIT_CODE_NORMAL);
}
}
示例4: resolveVariables
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
public File resolveVariables(File file) {
try {
String content = IOUtil.getContentOfURI(file.getAbsolutePath());
content = resolveVariables(content);
file.delete();
IOUtil.writeTextFile(file.getAbsolutePath(), content, getXMLEncoding());
return file;
} catch (IOException e) {
throw new I18NError("ErrorCreatingFile", e, file);
} finally {
advanceMonitor();
}
}
示例5: haveFile
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
private void haveFile(String filePath) throws IOException {
File file = new File(ROOT, filePath);
FileUtil.ensureDirectoryExists(file.getParentFile());
IOUtil.writeTextFile(file.getAbsolutePath(), "xxx");
}
示例6: haveFile
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
private void haveFile(String filePath) throws IOException {
java.io.File file = new java.io.File(ROOT, filePath);
FileUtil.ensureDirectoryExists(file.getParentFile());
IOUtil.writeTextFile(file.getAbsolutePath(), "xxx");
}
示例7: createSource1
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
protected File createSource1() throws IOException {
File sourceFile1;
sourceFile1 = new File("target" + File.separator + "FT1.txt");
IOUtil.writeTextFile(sourceFile1.getAbsolutePath(), "ABC");
return sourceFile1;
}
示例8: createSource2
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
protected File createSource2() throws IOException {
File sourceFile2;
sourceFile2 = new File("target" + File.separator + "FT2.txt");
IOUtil.writeTextFile(sourceFile2.getAbsolutePath(), "123");
return sourceFile2;
}
示例9: createTestFolders
import org.databene.commons.IOUtil; //导入方法依赖的package包/类
protected void createTestFolders() throws IOException {
FileUtil.ensureDirectoryExists(ROOT_DIR);
FileUtil.ensureDirectoryExists(SUB_DIR);
IOUtil.writeTextFile(ROOT_DIR_FILE.getAbsolutePath(), ROOT_DIR_FILE_CONTENT);
IOUtil.writeTextFile(SUB_DIR_FILE.getAbsolutePath(), SUB_DIR_FILE_CONTENT);
}