private static @ SourceUriType int getSourceUriType ( final Uri uri ) { if ( uri == null ) { return SOURCE_TYPE_UNKNOWN ; } if ( UriUtil . isNetworkUri ( uri ) ) { return SOURCE_TYPE_NETWORK ; } else if ( UriUtil . isLocalFileUri ( uri ) ) { if ( MediaUtils . isVideo ( MediaUtils . extractMime ( uri . getPath ( ) ) ) ) { return SOURCE_TYPE_LOCAL_VIDEO_FILE ; } else { return SOURCE_TYPE_LOCAL_IMAGE_FILE ; } } else if ( UriUtil . isLocalContentUri ( uri ) ) { return SOURCE_TYPE_LOCAL_CONTENT ; } else if ( UriUtil . isLocalAssetUri ( uri ) ) { return SOURCE_TYPE_LOCAL_ASSET ; } else if ( UriUtil . isLocalResourceUri ( uri ) ) { return SOURCE_TYPE_LOCAL_RESOURCE ; } else if ( UriUtil . isDataUri ( uri ) ) { return SOURCE_TYPE_DATA ; } else if ( UriUtil . isQualifiedResourceUri ( uri ) ) { return SOURCE_TYPE_QUALIFIED_RESOURCE ; } else { return SOURCE_TYPE_UNKNOWN ; } }
This is a utility method which returns the type of Uri