Class ResourceUtils

java.lang.Object
google.registry.util.ResourceUtils

public final class ResourceUtils extends Object
Utility methods related to reading java resources.
  • Method Details

    • readResourceUtf8

      public static String readResourceUtf8(String filename)
      Loads a resource from a file as a string, assuming UTF-8 encoding.
    • readResourceUtf8

      public static String readResourceUtf8(Class<?> contextClass, String filename)
      Loads a resource from a file (specified relative to the contextClass) as a string, assuming UTF-8 encoding.
    • readResourceUtf8

      public static String readResourceUtf8(URL url)
      Loads a resource from a URL as a string, assuming UTF-8 encoding.
    • readResourceBytes

      public static com.google.common.io.ByteSource readResourceBytes(Class<?> contextClass, String filename)
      Loads a file (specified relative to the contextClass) as a ByteSource.