org.apache.flink.util.FileUtils.writeFileUtf8()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.apache.flink.util.FileUtils.writeFileUtf8()方法的一些代码示例,展示了FileUtils.writeFileUtf8()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.writeFileUtf8()方法的具体详情如下:
包路径:org.apache.flink.util.FileUtils
类名称:FileUtils
方法名:writeFileUtf8

FileUtils.writeFileUtf8介绍

暂无

代码示例

代码示例来源:origin: apache/flink

public String createTempFile(String fileName, String contents) throws IOException {
  File f = createAndRegisterTempFile(fileName);
  if (!f.getParentFile().exists()) {
    f.getParentFile().mkdirs();
  }
  f.createNewFile();
  FileUtils.writeFileUtf8(f, contents);
  return f.toURI().toString();
}

代码示例来源:origin: apache/flink

private String createInputData(String data) throws Exception {
  File file = tempFolder.newFile("input");
  FileUtils.writeFileUtf8(file, data);
  return file.toURI().toString();
}

代码示例来源:origin: apache/flink

@Before
public void before() throws Exception{
  final File folder = tempFolder.newFolder();
  final File resultFile = new File(folder, UUID.randomUUID().toString());
  resultPath = resultFile.toURI().toString();
  File verticesFile = tempFolder.newFile();
  FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);
  File edgesFile = tempFolder.newFile();
  FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);
  verticesPath = verticesFile.toURI().toString();
  edgesPath = edgesFile.toURI().toString();
}

代码示例来源:origin: apache/flink

@Before
public void before() throws Exception{
  File resultFile = tempFolder.newFile();
  //Delete file because the Scala API does not respect WriteMode set by the configuration
  resultFile.delete();
  resultPath = resultFile.toURI().toString();
  File verticesFile = tempFolder.newFile();
  FileUtils.writeFileUtf8(verticesFile, PageRankData.VERTICES);
  File edgesFile = tempFolder.newFile();
  FileUtils.writeFileUtf8(edgesFile, PageRankData.EDGES);
  verticesPath = verticesFile.toURI().toString();
  edgesPath = edgesFile.toURI().toString();
}

代码示例来源:origin: apache/flink

sb.append(line).append("\n");
FileUtils.writeFileUtf8(file, sb.toString());

代码示例来源:origin: apache/flink

FileUtils.writeFileUtf8(file, sb.toString());

代码示例来源:origin: apache/flink

@Test
  public void testTopSpeedWindowingExampleITCase() throws Exception {
    File inputFile = temporaryFolder.newFile();
    FileUtils.writeFileUtf8(inputFile, TopSpeedWindowingExampleData.CAR_DATA);

    final String resultPath = temporaryFolder.newFolder().toURI().toString();

    TopSpeedWindowing.main(new String[] {
      "--input", inputFile.getAbsolutePath(),
      "--output", resultPath});

    compareResultsByLinesInMemory(TopSpeedWindowingExampleData.TOP_SPEEDS, resultPath);
  }
}

代码示例来源:origin: org.apache.flink/flink-test-utils_2.11

public String createTempFile(String fileName, String contents) throws IOException {
  File f = createAndRegisterTempFile(fileName);
  if (!f.getParentFile().exists()) {
    f.getParentFile().mkdirs();
  }
  f.createNewFile();
  FileUtils.writeFileUtf8(f, contents);
  return f.toURI().toString();
}

代码示例来源:origin: org.apache.flink/flink-test-utils

public String createTempFile(String fileName, String contents) throws IOException {
  File f = createAndRegisterTempFile(fileName);
  if (!f.getParentFile().exists()) {
    f.getParentFile().mkdirs();
  }
  f.createNewFile();
  FileUtils.writeFileUtf8(f, contents);
  return f.toURI().toString();
}

代码示例来源:origin: com.alibaba.blink/flink-test-utils

public String createTempFile(String fileName, String contents) throws IOException {
  File f = createAndRegisterTempFile(fileName);
  if (!f.getParentFile().exists()) {
    f.getParentFile().mkdirs();
  }
  f.createNewFile();
  FileUtils.writeFileUtf8(f, contents);
  return f.toURI().toString();
}

相关文章