@Test public void matchesBasic() throws Exception { assertTrue(MimeTypeFilter.matches("image/jpeg", "*jpeg")); assertFalse(MimeTypeFilter.matches("ImAgE/JpEg", "iMaGe*")); assertFalse(MimeTypeFilter.matches((String) null, "image/")); assertFalse(MimeTypeFilter.matches((String) null, "image/jpeg")); assertFalse(MimeTypeFilter.matches((String) null, "**")); assertFalse(MimeTypeFilter.matches("image/", "*", "*/*")); }
public static boolean matches(@Nullable String mimeType, @NonNull String filter) { if (mimeType == null) { return false; } final String[] mimeTypeParts = mimeType.split("/"); final String[] filterParts = filter.split("/"); return mimeTypeAgainstFilter(mimeTypeParts, filterParts); }
MimeTypeFilter { public static boolean matches(@Nullable String mimeType, @NonNull String filter) { if (mimeType == null) { return false; } final String[] mimeTypeParts = mimeType.split("/"); final String[] filterParts = filter.split("/"); return mimeTypeAgainstFilter(mimeTypeParts, filterParts); } }
MimeTypeFilter { public static boolean matches(@Nullable String mimeType, @NonNull String filter) { if (mimeType == null) { return false; } final String[] mimeTypeParts = mimeType.split("/"); final String[] filterParts = filter.split("/"); return mimeTypeAgainstFilter(mimeTypeParts, filterParts); } private  MimeTypeFilter(); }
MimeTypeFilter { public static boolean matches(@Nullable String mimeType, @NonNull String filter) { if (mimeType == null) { return false; } final String[] mimeTypeParts = mimeType.split("/"); final String[] filterParts = filter.split("/"); return mimeTypeAgainstFilter(mimeTypeParts, filterParts); } private  MimeTypeFilter(); static boolean matches(@Nullable String mimeType, @NonNull String filter); @Nullable static String matches(
            @Nullable String mimeType, @NonNull String[] filters); @Nullable static String matches(
            @Nullable String[] mimeTypes, @NonNull String filter); @NonNull static String[] matchesMany(
            @Nullable String[] mimeTypes, @NonNull String filter); }
MimeTypeFilter { public static boolean matches(@Nullable String mimeType, @NonNull String filter) { if (mimeType == null) { return false; } final String[] mimeTypeParts = mimeType.split("/"); final String[] filterParts = filter.split("/"); return mimeTypeAgainstFilter(mimeTypeParts, filterParts); } private  MimeTypeFilter(); static boolean matches(@Nullable String mimeType, @NonNull String filter); @Nullable static String matches(
            @Nullable String mimeType, @NonNull String[] filters); @Nullable static String matches(
            @Nullable String[] mimeTypes, @NonNull String filter); @NonNull static String[] matchesMany(
            @Nullable String[] mimeTypes, @NonNull String filter);  }