org.apache.cocoon.generation
Class ImageDirectoryGenerator

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.xml.AbstractXMLProducer
              |
              +--org.apache.cocoon.generation.AbstractGenerator
                    |
                    +--org.apache.cocoon.generation.ComposerGenerator
                          |
                          +--org.apache.cocoon.generation.DirectoryGenerator
                                |
                                +--org.apache.cocoon.generation.ImageDirectoryGenerator
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Disposable, Generator, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, SitemapModelComponent, XMLProducer

public class ImageDirectoryGenerator
extends DirectoryGenerator

An extension of DirectoryGenerators that adds extra attributes for image files.

Version:
CVS $Id: ImageDirectoryGenerator.java,v 1.4.2.1 2002/11/21 15:06:49 sylvain Exp $
Author:
Donald A. Ball Jr.

Field Summary
protected static java.lang.String IMAGE_HEIGHT_ATTR_NAME
           
protected static java.lang.String IMAGE_WIDTH_ATTR_NAME
           
 
Fields inherited from class org.apache.cocoon.generation.DirectoryGenerator
attributes, DATE_ATTR_NAME, dateFormatter, depth, DIR_NODE_NAME, excludeRE, FILE_NODE_NAME, FILENAME_ATTR_NAME, includeRE, isRequestedDirectory, LASTMOD_ATTR_NAME, PREFIX, rootRE, URI
 
Fields inherited from class org.apache.cocoon.generation.ComposerGenerator
manager
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
ImageDirectoryGenerator()
           
 
Method Summary
static java.lang.String getFileType(java.io.File file)
           
static int[] getGifSize(java.io.File file)
           
static int[] getJpegSize(java.io.File file)
           
static int[] getSize(java.io.File file)
           
protected  void setNodeAttributes(java.io.File path)
          Extends the setNodeAttributes method from the DirectoryGenerator by adding width and height attributes if the path is a GIF or a JPEG file.
 
Methods inherited from class org.apache.cocoon.generation.DirectoryGenerator
addPath, addPathWithAncestors, endNode, generate, getAncestors, isExcluded, isIncluded, isRoot, recycle, setup, startNode
 
Methods inherited from class org.apache.cocoon.generation.ComposerGenerator
compose, dispose
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

IMAGE_WIDTH_ATTR_NAME

protected static java.lang.String IMAGE_WIDTH_ATTR_NAME

IMAGE_HEIGHT_ATTR_NAME

protected static java.lang.String IMAGE_HEIGHT_ATTR_NAME
Constructor Detail

ImageDirectoryGenerator

public ImageDirectoryGenerator()
Method Detail

setNodeAttributes

protected void setNodeAttributes(java.io.File path)
                          throws org.xml.sax.SAXException
Extends the setNodeAttributes method from the DirectoryGenerator by adding width and height attributes if the path is a GIF or a JPEG file.
Overrides:
setNodeAttributes in class DirectoryGenerator
Following copied from class: org.apache.cocoon.generation.DirectoryGenerator
Parameters:
path - the file/directory to use when setting attributes
Throws:
org.xml.sax.SAXException - if an error occurs while setting the attributes

getSize

public static int[] getSize(java.io.File file)
                     throws java.io.FileNotFoundException,
                            java.io.IOException

getJpegSize

public static int[] getJpegSize(java.io.File file)
                         throws java.io.FileNotFoundException,
                                java.io.IOException

getGifSize

public static int[] getGifSize(java.io.File file)
                        throws java.io.FileNotFoundException,
                               java.io.IOException

getFileType

public static java.lang.String getFileType(java.io.File file)
                                    throws java.io.FileNotFoundException,
                                           java.io.IOException


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.