portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/capabilities/impl CapabilityValveImpl.java
Date Tue, 04 Jan 2005 16:06:21 GMT
weaver      2005/01/04 08:06:21

  Modified:    portal/src/java/org/apache/jetspeed/capabilities/impl
                        CapabilityValveImpl.java
  Log:
  Throw exception if capabilities could not be built instead of returning null.
  
  Revision  Changes    Path
  1.7       +8 -8      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/capabilities/impl/CapabilityValveImpl.java
  
  Index: CapabilityValveImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/capabilities/impl/CapabilityValveImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CapabilityValveImpl.java	1 Dec 2004 20:28:21 -0000	1.6
  +++ CapabilityValveImpl.java	4 Jan 2005 16:06:21 -0000	1.7
  @@ -22,6 +22,7 @@
   import org.apache.jetspeed.capabilities.CapabilityMap;
   import org.apache.jetspeed.capabilities.MediaType;
   import org.apache.jetspeed.capabilities.MimeType;
  +import org.apache.jetspeed.capabilities.UnableToBuildCapabilityMapException;
   import org.apache.jetspeed.pipeline.PipelineException;
   import org.apache.jetspeed.pipeline.valve.CapabilityValve;
   import org.apache.jetspeed.pipeline.valve.ValveContext;
  @@ -60,17 +61,16 @@
           String agent = request.getRequest().getHeader("User-Agent");
   
           // Get capability map
  -        CapabilityMap cm = capabilities.getCapabilityMap(agent);
  -
  -        if (cm == null)
  +        CapabilityMap cm;
  +        try
           {
  -            log.debug("Couldn't create capability map for agent: " + agent);
  +            cm = capabilities.getCapabilityMap(agent);
           }
  -        else
  +        catch (UnableToBuildCapabilityMapException e)
           {
  -            log.debug("Created Capability map for agent: " + agent);
  +           throw new PipelineException("Falied to create capabilitied:  "+e.getMessage(),
e);
           }
  -
  +        
           MediaType mediaType = cm.getPreferredMediaType();
           MimeType mimeType = cm.getPreferredType();
   
  
  
  

---------------------------------------------------------------------
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