Add golden files for request component routing maps

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157026188
This commit is contained in:
mountford 2017-05-24 13:06:16 -07:00 committed by Ben McIlwain
parent bb67841884
commit ddb0f5692e
23 changed files with 514 additions and 39 deletions

View file

@ -26,17 +26,21 @@ import java.net.URL;
/** Utility methods related to reading java resources. */
public final class ResourceUtils {
/** Loads a file as a string, assuming UTF-8 encoding. */
/** Loads a resource from a file as a string, assuming UTF-8 encoding. */
public static String readResourceUtf8(String filename) {
return resourceToString(getResource(filename));
return readResourceUtf8(getResource(filename));
}
/** Loads a file (specified relative to the contextClass) as a string, assuming UTF-8 encoding. */
/**
* Loads a resource from a file (specified relative to the contextClass) as a string, assuming
* UTF-8 encoding.
*/
public static String readResourceUtf8(Class<?> contextClass, String filename) {
return resourceToString(getResource(contextClass, filename));
return readResourceUtf8(getResource(contextClass, filename));
}
private static String resourceToString(URL url) {
/** Loads a resource from a URL as a string, assuming UTF-8 encoding. */
public static String readResourceUtf8(URL url) {
try {
return Resources.toString(url, UTF_8);
} catch (IOException e) {