com.thoughtworks.go.util.FileUtil.fileseparator()方法的使用及代码示例

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

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

FileUtil.fileseparator介绍

暂无

代码示例

代码示例来源:origin: gocd/gocd

private OutputStream target(String targetFile) throws FileNotFoundException {
  return new FileOutputStream(testFolder.getAbsolutePath() + FileUtil.fileseparator() + targetFile);
}

代码示例来源:origin: gocd/gocd

private OutputStream target(String targetFile) throws FileNotFoundException {
  return new FileOutputStream(testFolder.getAbsolutePath() + FileUtil.fileseparator() + targetFile);
}

代码示例来源:origin: gocd/gocd

private InputStream source(String filename) throws IOException {
  return new ClassPathResource(FileUtil.fileseparator() + "data" + FileUtil.fileseparator() + filename).getInputStream();
}

代码示例来源:origin: gocd/gocd

private InputStream source(String filename) throws IOException {
  return new ClassPathResource(FileUtil.fileseparator() + "data" + FileUtil.fileseparator() + filename).getInputStream();
}

代码示例来源:origin: gocd/gocd

public Properties generate(File[] allTestFiles, String uploadDestPath) {
  FileOutputStream transformedHtml = null;
  File mergedResults = new File(folderToUpload.getAbsolutePath() + FileUtil.fileseparator() + TEST_RESULTS_FILE);
  File mergedResource = null;
  FileInputStream mergedFileStream = null;
  try {
    mergedResource = mergeAllTestResultToSingleFile(allTestFiles);
    transformedHtml = new FileOutputStream(mergedResults);
    try {
      mergedFileStream = new FileInputStream(mergedResource);
      Source xmlSource = new StreamSource(mergedFileStream);
      StreamResult result = new StreamResult(transformedHtml);
      templates.newTransformer().transform(xmlSource, result);
    } catch (Exception e) {
      publisher.reportErrorMessage("Unable to publish test properties. Error was " + e.getMessage(), e);
    }
    extractProperties(mergedResults);
    publisher.upload(mergedResults, uploadDestPath);
    return null;
  } catch (Exception e) {
    publisher.reportErrorMessage("Unable to publish test properties. Error was " + e.getMessage(), e);
  } finally {
    IOUtils.closeQuietly(mergedFileStream);
    IOUtils.closeQuietly(transformedHtml);
    if (mergedResource != null) {
      mergedResource.delete();
    }
  }
  return new Properties();
}

代码示例来源:origin: gocd/gocd

@Test public void shouldConvertFileCorrectly() throws Exception {
  final Foo object = new Foo();
  final GoConfigFieldWriter field = new GoConfigFieldWriter(Foo.class.getDeclaredField("directory"), object, configCache, null);
  final Element element = new Element("foo");
  element.setAttribute("directory", "foo" + FileUtil.fileseparator() + "dir");
  field.setValueIfNotNull(element, object);
  assertThat(object.directory.getPath(), is("foo" + FileUtil.fileseparator() + "dir"));
}

相关文章