当前位置: 首页>>代码示例>>Java>>正文


Java IOUtil.writeTextFile方法代码示例

本文整理汇总了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();
 }
 
开发者ID:raphaelfeng,项目名称:benerator,代码行数:18,代码来源:ProjectBuilder.java

示例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;
}
 
开发者ID:AludraTest,项目名称:aludratest,代码行数:9,代码来源:GitClientIntegrationTest.java

示例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);
       }
}
 
开发者ID:raphaelfeng,项目名称:benerator,代码行数:12,代码来源:BeneratorGUI.java

示例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();
}
  }
 
开发者ID:raphaelfeng,项目名称:benerator,代码行数:14,代码来源:ProjectBuilder.java

示例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");
}
 
开发者ID:AludraTest,项目名称:aludratest,代码行数:6,代码来源:LocalFileServiceTest.java

示例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");
}
 
开发者ID:AludraTest,项目名称:aludratest,代码行数:6,代码来源:FileTest.java

示例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;
}
 
开发者ID:raphaelfeng,项目名称:benerator,代码行数:7,代码来源:FileTest.java

示例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;
}
 
开发者ID:raphaelfeng,项目名称:benerator,代码行数:7,代码来源:FileTest.java

示例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);
  }
 
开发者ID:raphaelfeng,项目名称:benerator,代码行数:7,代码来源:FileContentGeneratorTest.java


注:本文中的org.databene.commons.IOUtil.writeTextFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。