org.robolectric.res.Fs.join()方法的使用及代码示例

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

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

Fs.join介绍

暂无

代码示例

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

public static Path resourceFile(String... pathParts) {
 return Fs.join(resourcesBaseDir(), pathParts);
}

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

private static Path resourceFile(String... pathParts) {
 return Fs.join(resourcesBaseDir(), pathParts);
}

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

private static Path resourceFile(String... pathParts) {
 return Fs.join(resourcesBaseDir(), pathParts);
}

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

@Nonnull
private ResourcePath createRuntimeSdkResourcePath(DependencyResolver dependencyResolver) {
 try {
  Fs systemResFs = Fs.fromJar(dependencyResolver.getLocalArtifactUrl(sdkConfig.getAndroidSdkDependency()));
  Class<?> androidRClass = getRobolectricClassLoader().loadClass("android.R");
  Class<?> androidInternalRClass = getRobolectricClassLoader().loadClass("com.android.internal.R");
  // TODO: verify these can be loaded via raw-res path
  return new ResourcePath(androidRClass,
    systemResFs.join("raw-res/res"),
    systemResFs.join("raw-res/assets"),
    androidInternalRClass);
 } catch (ClassNotFoundException e) {
  throw new RuntimeException(e);
 }
}

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

public static FsFile fileFromPath(String urlString) {
 if (urlString.startsWith("jar:")) {
  String[] parts = urlString.replaceFirst("jar:", "").split("!");
  Fs fs = new JarFs(new File(parts[0]));
  return fs.join(parts[1].substring(1));
 } else {
  return new FileFsFile(new File(urlString));
 }
}

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

/**
 * @deprecated Use {@link #fromURL(URL)} instead.
 */
@Deprecated
public static FsFile fileFromPath(String urlString) {
 if (urlString.startsWith("jar:")) {
  String[] parts = urlString.replaceFirst("jar:", "").split("!", 0);
  Fs fs = new JarFs(new File(parts[0]));
  return fs.join(parts[1].substring(1));
 } else {
  return new FileFsFile(new File(urlString));
 }
}

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

public static FsFile fromURL(URL url) {
 switch (url.getProtocol()) {
  case "file":
   return new FileFsFile(new File(url.getPath()));
  case "jar":
   String[] parts = url.getPath().split("!", 0);
   try {
    Fs fs = fromJar(new URL(parts[0]));
    return fs.join(parts[1].substring(1));
   } catch (MalformedURLException e) {
    throw new IllegalArgumentException(e);
   }
  default:
   throw new IllegalArgumentException("unsupported fs type for '" + url + "'");
 }
}

相关文章