@Test public void matchesManyFilters() throws Exception { assertEquals("**"})); assertEquals("image*", MimeTypeFilter.matches( "image/jpeg", new String[] {"not/matching", "*jpeg", MimeTypeFilter.matches( "image/jpeg", new String[] {"*/png", "*/jpeg"})); assertNull(MimeTypeFilter.matches("image/jpeg", new String[] {})); assertNull(MimeTypeFilter.matches("image/jpeg", new String[] {"image/png", "video/jpeg"})); assertNull(MimeTypeFilter.matches("image/jpeg", new String[] {"video/jpeg", "image/png"})); assertNull(MimeTypeFilter.matches(null, new String[] {"**" })); assertNull(MimeTypeFilter.matches("", new String[] { "**" })); assertNull(MimeTypeFilter.matches("*/", new String[] { "*/*" })); }
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);  }