當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。