All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.res.RawResourceLoader Maven / Gradle / Ivy

There is a newer version: 3.4-rc2
Show newest version
package org.robolectric.res;

public class RawResourceLoader {
  private final ResourcePath resourcePath;

  public RawResourceLoader(ResourcePath resourcePath) {
    this.resourcePath = resourcePath;
  }

  public void loadTo(ResBundle rawResourceFiles) {
    if (resourcePath.rawDir != null) {
      FsFile[] files = resourcePath.rawDir.listFiles();
      if (files != null) {
        for (FsFile file : files) {
          String fileBaseName = file.getBaseName();
          rawResourceFiles.put("raw", fileBaseName, file, new XmlLoader.XmlContext(resourcePath.getPackageName(), file));
        }
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy