org.robolectric.util.Util.file()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(153)

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

Util.file介绍

暂无

代码示例

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

public static File file(String... pathParts) {
 return file(new File("."), pathParts);
}

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

private static Path resourcesBaseDir() {
 // Try to locate the manifest file as a classpath resource.
 final String resourceName = "/src/test/resources/AndroidManifest.xml";
 final URL resourceUrl = TestRunnerWithManifest.class.getResource(resourceName);
 if (resourceUrl != null && "file".equals(resourceUrl.getProtocol())) {
  // Construct a path to the manifest file relative to the current working directory.
  final URI workingDirectory = URI.create(System.getProperty("user.dir"));
  final URI absolutePath = URI.create(resourceUrl.getPath());
  final URI relativePath = workingDirectory.relativize(absolutePath);
  return new File(relativePath.toString()).getParentFile().toPath();
 }
 // Return a path relative to the current working directory.
 return Util.file("src", "test", "resources").toPath();
}

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

private static Path resourcesBaseDir() {
 // Try to locate the manifest file as a classpath resource.
 final String resourceName = "/src/test/resources/AndroidManifest.xml";
 final URL resourceUrl = TestRunnerWithManifest.class.getResource(resourceName);
 if (resourceUrl != null && "file".equals(resourceUrl.getProtocol())) {
  // Construct a path to the manifest file relative to the current working directory.
  final URI workingDirectory = URI.create(System.getProperty("user.dir"));
  final URI absolutePath = URI.create(resourceUrl.getPath());
  final URI relativePath = workingDirectory.relativize(absolutePath);
  return new File(relativePath.toString()).getParentFile().toPath();
 }
 // Return a path relative to the current working directory.
 return Util.file("src", "test", "resources").toPath();
}

代码示例来源:origin: org.robolectric/robolectric-utils

public static File file(String... pathParts) {
 return file(new File("."), pathParts);
}

代码示例来源:origin: org.robolectric/utils

public static File file(String... pathParts) {
 return file(new File("."), pathParts);
}

相关文章