Class Format


public class Format
extends java.lang.Object

Format abstraction. The list of formats defined together with the subdirectory structure used to manage the different formats of a file on disk are accessible through this class.
This differentiates between downloadable and non-downloadable formats as given in the corr. field downloadable in the table fielformats.

Inner Class Summary
static class Format.Detail
          Inner class representing detailed info on a format definition.
Constructor Summary
          Empty constructor needed for inner class references.
Method Summary
 java.util.Vector getAvailableFormatList(java.sql.Connection con, java.lang.String basepath, java.lang.String filename)
          Return a list of formats available for the given image.
 org.jdom.Element getAvailableFormatListElement(java.sql.Connection con, java.lang.String basepath, java.lang.String filename)
          Get List of formats for the given file, marking unavailable formats with an attribute 'unavailable'.
static Format.Detail getFormat(java.sql.Connection con, java.lang.String reqFormat)
static Format.Detail getFormatByExtension(java.sql.Connection con, java.lang.String extension, boolean uploadFormat)
static Format.Detail getFormatById(java.sql.Connection con, int id)
          Get a format definition by its ID.
static Format.Detail getFormatByName(java.sql.Connection con, java.lang.String name)
 java.util.Vector getFormatList(java.sql.Connection con, boolean downloadable)
          Get the list of available/supported formats.
 org.jdom.Element getFormatListElement(java.sql.Connection con, boolean downloadable)
          Get Format List as a JDOM Element
static void main(java.lang.String[] args)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Format()
Empty constructor needed for inner class references.
Method Detail


public java.util.Vector getFormatList(java.sql.Connection con,
                                      boolean downloadable)
                               throws java.sql.SQLException
Get the list of available/supported formats. This simply reads the list of formats from the DB table. Use getFormatDetail() for additional information on a single format.
con - The DB connection.
downloadable - true: List only downloadable, false: list all.


public java.util.Vector getAvailableFormatList(java.sql.Connection con,
                                               java.lang.String basepath,
                                               java.lang.String filename)
                                        throws java.sql.SQLException,
Return a list of formats available for the given image. Note: This lists only formats marked as downloadable in the DB (attribute in table fileformats)
con - A Connection object.
basepath - The Basepath where the image directory structure starts.
filename - The filename for this image without extension.
A Vector containing all Format IDs available for this file.


public org.jdom.Element getFormatListElement(java.sql.Connection con,
                                             boolean downloadable)
                                      throws XMLServException
Get Format List as a JDOM Element


public org.jdom.Element getAvailableFormatListElement(java.sql.Connection con,
                                                      java.lang.String basepath,
                                                      java.lang.String filename)
                                               throws XMLServException
Get List of formats for the given file, marking unavailable formats with an attribute 'unavailable'.


public static Format.Detail getFormatById(java.sql.Connection con,
                                          int id)
                                   throws XMLServException
Get a format definition by its ID.


public static Format.Detail getFormatByName(java.sql.Connection con,
                                            java.lang.String name)
                                     throws XMLServException


public static Format.Detail getFormatByExtension(java.sql.Connection con,
                                                 java.lang.String extension,
                                                 boolean uploadFormat)
                                          throws XMLServException


public static Format.Detail getFormat(java.sql.Connection con,
                                      java.lang.String reqFormat)
                               throws XMLServException


public static void main(java.lang.String[] args)