portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shes...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/util MimeType.java
Date Thu, 08 Mar 2001 16:18:59 GMT
shesmer     01/03/08 08:18:59

  Modified:    src/java/org/apache/jetspeed/util MimeType.java
  Log:
  more stable version of MimeType
  
  Revision  Changes    Path
  1.5       +10 -6     jakarta-jetspeed/src/java/org/apache/jetspeed/util/MimeType.java
  
  Index: MimeType.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/MimeType.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MimeType.java	2001/03/07 06:49:56	1.4
  +++ MimeType.java	2001/03/08 16:18:55	1.5
  @@ -60,7 +60,7 @@
   utility manipulation methods.
   
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: MimeType.java,v 1.4 2001/03/07 06:49:56 taylor Exp $
  +@version $Id: MimeType.java,v 1.5 2001/03/08 16:18:55 shesmer Exp $
   */
   public class MimeType {
   
  @@ -72,6 +72,9 @@
       private String mimeType = "";
       
       public MimeType( String mimeType ) {
  +        if(mimeType == null) {
  +            throw new NullPointerException();
  +        }
           this.mimeType = mimeType;
       }
       
  @@ -105,20 +108,21 @@
       public String toString() {
           return this.mimeType;
       }
  -    
  +
       /**
       Compare one MimeType to another
       */
       public boolean equals( Object obj ) {
  -        if ( obj.getClass().getName().equals( this.getClass().getName() ) ) {
  -            
  +        if ( this == obj) {
  +            return true;
  +        }
  +        
  +        if (obj instanceof MimeType) {
               MimeType comp = (MimeType)obj;
               return this.toString().equals( comp.toString() );
  -            
           } else {
               return false;
           }
  -        
       }
       
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message