Package google.registry.util
Class ResourceUtils
java.lang.Object
google.registry.util.ResourceUtils
Utility methods related to reading java resources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.io.ByteSource
readResourceBytes
(Class<?> contextClass, String filename) Loads a file (specified relative to the contextClass) as a ByteSource.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.static String
readResourceUtf8
(String filename) Loads a resource from a file as a string, assuming UTF-8 encoding.static String
readResourceUtf8
(URL url) Loads a resource from a URL as a string, assuming UTF-8 encoding.
-
Method Details
-
readResourceUtf8
Loads a resource from a file as a string, assuming UTF-8 encoding. -
readResourceUtf8
Loads a resource from a file (specified relative to the contextClass) as a string, assuming UTF-8 encoding. -
readResourceUtf8
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.
-