java.lang.Object | |
↳ | com.facebook.common.util.UriUtil |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DATA_SCHEME | Data scheme for URIs | |||||||||
String | HTTPS_SCHEME | ||||||||||
String | HTTP_SCHEME | http scheme for URIs | |||||||||
String | LOCAL_ASSET_SCHEME | Asset scheme for URIs | |||||||||
String | LOCAL_CONTENT_SCHEME | Content URI scheme for URIs | |||||||||
String | LOCAL_FILE_SCHEME | File scheme for URIs | |||||||||
String | LOCAL_RESOURCE_SCHEME | Resource scheme for URIs |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UriUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static String |
getRealPathFromUri(ContentResolver contentResolver, Uri srcUri)
Get the path of a file from the Uri.
| ||||||||||
static String | getSchemeOrNull(Uri uri) | ||||||||||
static Uri |
getUriForFile(File file)
Returns a URI for a given file using
fromFile(File) . | ||||||||||
static Uri |
getUriForResourceId(int resourceId)
Return a URI for the given resource ID.
| ||||||||||
static boolean |
isDataUri(Uri uri)
Check if the uri is a data uri
| ||||||||||
static boolean |
isLocalAssetUri(Uri uri)
Check if uri represents local asset
| ||||||||||
static boolean |
isLocalCameraUri(Uri uri)
Checks if the given URI is for a photo from the device's local media store.
| ||||||||||
static boolean |
isLocalContactUri(Uri uri)
Checks if the given URI is a general Contact URI, and not a specific display photo.
| ||||||||||
static boolean |
isLocalContentUri(Uri uri)
Check if uri represents local content
| ||||||||||
static boolean |
isLocalFileUri(Uri uri)
Check if uri represents local file
| ||||||||||
static boolean |
isLocalResourceUri(Uri uri)
Check if uri represents local resource
| ||||||||||
static boolean |
isNetworkUri(Uri uri)
/**
Check if uri represents network resource
| ||||||||||
static Uri |
parseUriOrNull(String uriAsString)
A wrapper around
parse(String) that returns null if the input is null. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Data scheme for URIs
http scheme for URIs
Asset scheme for URIs
Content URI scheme for URIs
File scheme for URIs
Resource scheme for URIs
Get the path of a file from the Uri.
contentResolver | the content resolver which will query for the source file |
---|---|
srcUri | The source uri |
uri | uri to extract scheme from, possibly null |
---|
Returns a URI for a given file using fromFile(File)
.
file | a file with a valid path |
---|
Return a URI for the given resource ID.
The returned URI consists of a LOCAL_RESOURCE_SCHEME
scheme and
the resource ID as path.
resourceId | the resource ID to use |
---|
Check if the uri is a data uri
Check if uri represents local asset
uri | uri to check |
---|
Checks if the given URI is for a photo from the device's local media store.
uri | the URI to check |
---|
Checks if the given URI is a general Contact URI, and not a specific display photo.
uri | the URI to check |
---|
Check if uri represents local content
uri | uri to check |
---|
Check if uri represents local file
uri | uri to check |
---|
Check if uri represents local resource
uri | uri to check |
---|
LOCAL_RESOURCE_SCHEME
/** Check if uri represents network resource
uri | uri to check |
---|
A wrapper around parse(String)
that returns null if the input is null.
uriAsString | the uri as a string |
---|