public class DataUriUtils extends Object
Uri objects that use the dataability scheme.UriSystemCapability.Aafwk#ABILITY| 构造器 | 说明 |
|---|---|
DataUriUtils() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static Uri |
attachId(Uri dataUri,
long id) |
Attaches the given ID to the end of the path component of the given URI.
|
static Uri |
deleteId(Uri dataUri) |
Deletes the ID from the end of the path component of the given URI.
|
static long |
getId(Uri dataUri) |
Obtains the ID attached to the end of the path component of the given URI.
|
static Uri |
updateId(Uri dataUri,
long id) |
Updates the ID in the specified
dataUri. |
public static long getId(Uri dataUri)
dataUri - Indicates the Uri object from which the ID is to be obtained.-1 if the given dataUri does not contain a path component.NumberFormatException - Throws this exception if the last segment of the path component is not a number.IllegalArgumentException - Throws this exception if dataUri is null.public static Uri attachId(Uri dataUri, long id)
dataUri - Indicates the Uri object to which the ID is to be attached.id - Indicates the ID to attach.Uri object with the given ID attached.IllegalArgumentException - Throws this exception if the uri is illegalpublic static Uri deleteId(Uri dataUri)
dataUri - Indicates the Uri object from which the ID is to be deleted.Uri object with the ID deleted.IllegalArgumentException - Throws this exception if dataUri is null or
does not contain a path component.NumberFormatException - Throws this exception if the last segment of the path component is not a number.public static Uri updateId(Uri dataUri, long id)
dataUri.dataUri - Indicates the Uri object to be updated.id - Indicates the new ID.Uri object.IllegalArgumentException - Throws this exception if the format of the specified
dataUri is incorrect.NumberFormatException - Throws this exception if the last segment of the path
in the specified dataUri is not a number.