Package okhttp3.mock
Class AndroidResources
- java.lang.Object
-
- okhttp3.mock.AndroidResources
-
public final class AndroidResources extends java.lang.ObjectA helper class to provide responses from Android's sources
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.InputStreamasset(android.content.Context context, java.lang.String name)Loads the content from the given assetstatic java.io.InputStreamrawRes(android.content.Context context, int resource)Loads the content from the given raw resource
-
-
-
Method Detail
-
asset
public static java.io.InputStream asset(android.content.Context context, java.lang.String name)Loads the content from the given asset- Parameters:
context- the android contextname- the name of the asset- Returns:
- the content as an
InputStream
-
rawRes
public static java.io.InputStream rawRes(android.content.Context context, @RawRes int resource)Loads the content from the given raw resource- Parameters:
context- the android contextresource- the id of the resource- Returns:
- the content as an
InputStream
-
-