info.evccit.utils
Class XImageSize

java.lang.Object
  extended byinfo.evccit.utils.XImageSize

public class XImageSize
extends java.lang.Object


Constructor Summary
XImageSize()
           
 
Method Summary
static org.apache.xpath.NodeSet getDimensions(org.w3c.dom.NodeList fileNameList)
          Create <imageSize> element(s) for a file or files given in a node list.
static org.apache.xpath.NodeSet getDimensions(org.w3c.dom.NodeList basePathList, org.w3c.dom.NodeList fileNameList)
          Create <imageSize> element(s) from a base path name and file list given as NodeLists.
static org.w3c.dom.Node getDimensions(org.w3c.dom.NodeList basePathList, java.lang.String fileName)
          Create <imageSize> element(s) from a base path in a NodeList and fileName in a String.
static org.w3c.dom.Node getDimensions(java.lang.String fileName)
          Create an <imageSize> element for a file given its file name.
static org.apache.xpath.NodeSet getDimensions(java.lang.String basePath, org.w3c.dom.NodeList fileNameList)
          Create <imageSize> element(s) from a base path String and fileName NodeList.
static org.w3c.dom.Node getDimensions(java.lang.String pathName, java.lang.String fileName)
          Create an <imageSize> element for a file given its path and file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XImageSize

public XImageSize()
Method Detail

getDimensions

public static org.w3c.dom.Node getDimensions(java.lang.String fileName)
Create an <imageSize> element for a file given its file name. Hands the file name to getDimensionsFrom File( ), which returns a Dimension object. getDimensions() then creates an <imageSize> element with a "fileName" attribute equal to the full path name (with / as the file separator), and width and height attributes equal to the image file's width and height.

Parameters:
fileName - Complete path and file name
Returns:
A node containing an <imageSize> element

getDimensions

public static org.w3c.dom.Node getDimensions(java.lang.String pathName,
                                             java.lang.String fileName)
Create an <imageSize> element for a file given its path and file name. Append the filename to the pathName and then call getDimensions( String fileName )

Parameters:
pathName - Base path name for the file
fileName - File name (without path)
Returns:
A node containing an <ImageSize> element

getDimensions

public static org.w3c.dom.Node getDimensions(org.w3c.dom.NodeList basePathList,
                                             java.lang.String fileName)
Create <imageSize> element(s) from a base path in a NodeList and fileName in a String. The base path name is the text from the first node in basePathList. Collect the text from each node in the fileNameList, and pass it with the base path to getDimensions( String pathName, string fileName ).

Parameters:
basePathList - A list of nodes, the first of which contains the base path for all the files
fileName - A String containing a file name
Returns:
A Node containing one <imageSize> element

getDimensions

public static org.apache.xpath.NodeSet getDimensions(org.w3c.dom.NodeList fileNameList)
Create <imageSize> element(s) for a file or files given in a node list. Collect the text from each node in the fileNameList, and use it as an argument to getDimensions( String fileName ).

Parameters:
fileNameList - A list of nodes, each of whose text content is a file name
Returns:
A set of nodes containing one <imageSize> element for each of the file names in the fileNameList.

getDimensions

public static org.apache.xpath.NodeSet getDimensions(org.w3c.dom.NodeList basePathList,
                                                     org.w3c.dom.NodeList fileNameList)
Create <imageSize> element(s) from a base path name and file list given as NodeLists. The base path name is the text from the first node in basePathList. Collect the text from each node in the fileNameList, and pass it with the base path to getDimensions( String pathName, string fileName ).

Parameters:
basePathList - A list of nodes, the first of which contains the base path for all the files
fileNameList - A list of nodes, each of whose text content is a file name
Returns:
A set of nodes containing one <imageSize> element for each of the file names in the fileNameList.

getDimensions

public static org.apache.xpath.NodeSet getDimensions(java.lang.String basePath,
                                                     org.w3c.dom.NodeList fileNameList)
Create <imageSize> element(s) from a base path String and fileName NodeList. Collect the text from each node in the fileNameList, and pass it with the base path to getDimensions( String pathName, string fileName ).

Parameters:
basePath - A String containing the base path for all the files
fileNameList - A list of nodes, each of whose text content is a file name
Returns:
A set of nodes containing one <imageSize> element for each of the file names in the fileNameList.