@Test public void validatePartial() { if (mExpectedErrorMessage == null) { for (int i = 1; i <= mSourceFileName.length(); i++) { String partialName = mSourceFileName.substring(0, i); String actual = FileResourceNameValidator.getErrorTextForPartialName( partialName, mResourceType); assertNull("Was not expecting error for " + partialName, actual); } } else { String actual = FileResourceNameValidator.getErrorTextForPartialName( mSourceFileName, mResourceType); if (!mExpectedErrorMessage.startsWith("The file name must end with")) { assertEquals(mExpectedErrorMessage, actual); } } }
@Nullable public static String getErrorTextForPartialName( @NonNull final String partialFileNameWithExt, @NonNull final ResourceType resourceType) { return getErrorTextForFileResource(partialFileNameWithExt, resourceType, true); }
FileResourceNameValidator { @Nullable public static String getErrorTextForPartialName( @NonNull final String partialFileNameWithExt, @NonNull final ResourceType resourceType) { return getErrorTextForFileResource(partialFileNameWithExt, resourceType, true); } }
FileResourceNameValidator { @Nullable public static String getErrorTextForPartialName( @NonNull final String partialFileNameWithExt, @NonNull final ResourceType resourceType) { return getErrorTextForFileResource(partialFileNameWithExt, resourceType, true); } private  FileResourceNameValidator(); }
FileResourceNameValidator { @Nullable public static String getErrorTextForPartialName( @NonNull final String partialFileNameWithExt, @NonNull final ResourceType resourceType) { return getErrorTextForFileResource(partialFileNameWithExt, resourceType, true); } private  FileResourceNameValidator(); static void validate(@NonNull File file, @NonNull ResourceType resourceType); @Nullable static String getErrorTextForFileResource(@NonNull final String fileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForPartialName(
            @NonNull final String partialFileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForNameWithoutExtension(
            @NonNull final String fileNameWithoutExt); }
FileResourceNameValidator { @Nullable public static String getErrorTextForPartialName( @NonNull final String partialFileNameWithExt, @NonNull final ResourceType resourceType) { return getErrorTextForFileResource(partialFileNameWithExt, resourceType, true); } private  FileResourceNameValidator(); static void validate(@NonNull File file, @NonNull ResourceType resourceType); @Nullable static String getErrorTextForFileResource(@NonNull final String fileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForPartialName(
            @NonNull final String partialFileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForNameWithoutExtension(
            @NonNull final String fileNameWithoutExt);  }