public final class FileResourceNameValidator
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getErrorTextForFileResource(java.lang.String fileNameWithExt,
com.android.resources.ResourceType resourceType)
Validate a single-file resource name.
|
static java.lang.String |
getErrorTextForNameWithoutExtension(java.lang.String fileNameWithoutExt)
Validate a single-file resource name.
|
static java.lang.String |
getErrorTextForPartialName(java.lang.String partialFileNameWithExt,
com.android.resources.ResourceType resourceType)
Validate a file-based resource name as it is being typed in a text field.
|
static void |
validate(java.io.File file,
com.android.resources.ResourceType resourceType)
Validate a single-file resource name.
|
public static void validate(@NonNull java.io.File file, @NonNull com.android.resources.ResourceType resourceType) throws MergingException
file
- the file resource to validate.resourceType
- the resource type.MergingException
- is the resource name is not valid.@Nullable public static java.lang.String getErrorTextForFileResource(@NonNull java.lang.String fileNameWithExt, @NonNull com.android.resources.ResourceType resourceType)
fileNameWithExt
- the resource file name to validate.resourceType
- the resource type.@Nullable public static java.lang.String getErrorTextForPartialName(@NonNull java.lang.String partialFileNameWithExt, @NonNull com.android.resources.ResourceType resourceType)
partialFileNameWithExt
- the resource file name or prefix of file name to validate.resourceType
- the resource type.@Nullable public static java.lang.String getErrorTextForNameWithoutExtension(@NonNull java.lang.String fileNameWithoutExt)
fileNameWithoutExt
- The resource file name to validate, without an extension.