cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl JPEGSourceInspector.java
Date Thu, 23 Oct 2003 16:57:17 GMT
unico       2003/10/23 09:57:17

  Modified:    src/blocks/repository/java/org/apache/cocoon/components/source/impl
                        JPEGSourceInspector.java
  Log:
  add method getExposedSourcePropertyTypes(), improve documentation
  
  Revision  Changes    Path
  1.2       +27 -6     cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/JPEGSourceInspector.java
  
  Index: JPEGSourceInspector.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/JPEGSourceInspector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JPEGSourceInspector.java	22 Oct 2003 18:53:06 -0000	1.1
  +++ JPEGSourceInspector.java	23 Oct 2003 16:57:17 -0000	1.2
  @@ -69,15 +69,32 @@
   public class JPEGSourceInspector extends AbstractLogEnabled implements 
       SourceInspector, ThreadSafe {
   
  -    private String PROPERTY_NS = "http://apache.org/cocoon/inspector/jpeg/1.0";
  -    private static String IMAGE_WIDTH_PROPERTY_NAME = "width";
  -    private static String IMAGE_HEIGHT_PROPERTY_NAME = "height";
  -
  +    /**
  +     * The namespace uri of the properties exposed by this SourceInspector.
  +     * The value is <code>http://apache.org/cocoon/inspector/jpeg/1.0</code>
.
  +     */
  +    private static final String PROPERTY_NS = "http://apache.org/cocoon/inspector/jpeg/1.0";
  +    
  +    /**
  +     * <code>width</code> property name.
  +     */
  +    private static final String IMAGE_WIDTH_PROPERTY_NAME = "width";
  +    
  +    /**
  +     * <code>height</code> property name.
  +     */
  +    private static final String IMAGE_HEIGHT_PROPERTY_NAME = "height";
  +    
  +    private static final String[] EXPOSED_PROPERTIES = new String[] {
  +        PROPERTY_NS + "#" + IMAGE_WIDTH_PROPERTY_NAME,
  +        PROPERTY_NS + "#" + IMAGE_HEIGHT_PROPERTY_NAME
  +    };
  +    
  +    
       public SourceProperty getSourceProperty(Source source, String namespace, String name)

           throws SourceException {
   
           if ((namespace.equals(PROPERTY_NS)) && 
  -            ((name.equals(IMAGE_WIDTH_PROPERTY_NAME)) || (name.equals(IMAGE_HEIGHT_PROPERTY_NAME)))
&& 
               (source.getURI().endsWith(".jpg")) && (isJPEGFile(source))) {
   
               if (name.equals(IMAGE_WIDTH_PROPERTY_NAME))
  @@ -189,6 +206,10 @@
                       in.close(); 
                   } catch (Exception e) {}
           }
  +    }
  +    
  +    public String[] getExposedSourcePropertyTypes() {
  +        return EXPOSED_PROPERTIES;
       }
   
   }
  
  
  

Mime
View raw message