abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject 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/
Date Wed, 13 Sep 2006 19:12:14 GMT
On 9/13/06, jmsnell@apache.org <jmsnell@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

Mime
View raw message