You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2006/09/13 21:12:14 UTC

Re: svn commit: r443068 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/ core/src/main/java/org/apache/abdera/util/ parser/src/main/java/org/apache/abdera/parser/stax/

On 9/13/06, jmsnell@apache.org <jm...@apache.org> wrote:

> +  public static boolean isMatch(MimeType a, MimeType b) {
> +    try {
> +      final MimeType WILDCARD = new MimeType("*/*");
> +      if (a == null || b == null) return true;
> +      if (a.match(b)) return true;
> +      if (a.equals(WILDCARD)) return true;
> +      if (a.getPrimaryType().equals("*")) {
> +        MimeType c = new MimeType(b.getPrimaryType(), a.getSubType());
> +        return c.match(b);
> +      }
> +      if (b.getPrimaryType().equals("*")) {
> +        MimeType c = new MimeType(a.getPrimaryType(), b.getSubType());
> +        return c.match(a);
> +      }
> +    } catch (Exception e) {}
> +    return false;

It seems like WILDCARD would be a nice chance for a static member, to
avoid having to allocate one each time through here...

-garrett