org.weborganic.bastille.xml
Class GetXMLFileInfo

java.lang.Object
  extended by org.weborganic.bastille.xml.GetXMLFileInfo
All Implemented Interfaces:
Cacheable, ContentGenerator

public final class GetXMLFileInfo
extends Object
implements ContentGenerator, Cacheable

Returns information about a file in the WEB-INF/xml based on the specified by the path info.

If the file is a directory, lists the files corresponding to the specified directory.

Configuration

The root XML folder can be configured globally using the Berlioz configuration:

For example:

<node name="bastille">
   <map/>
   <node name="xml">
     <map>
       <entry key="folder"     value="xml/content"/>
     </map>
   </node>
 </node>
 

Parameters

The path to the resource can be specified using the path parameter, if the path parameter is not specified, the path will use the path info.

Returned XML

XML for a file:

<file name="[filename]"
         path="[path_to_folder]"
         type="file"
         media-type="[media_type]"
         length="[file_size]"
         modified="[ISO8601_datetime]">
 

XML for a folder:

<file name="[filename]" path="[path_from_root]" type="folder">
     <!-- for each file... -->
     <file name="" ... />
   </file>
 

XML if the file does not exist,

<file name="[filename]"
         path="[path_to_folder]"
         status="not-found">
 

File attributes

Since:
0.6.0

Constructor Summary
GetXMLFileInfo()
           
 
Method Summary
 String getETag(ContentRequest req)
           
 void process(ContentRequest req, XMLWriter xml)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetXMLFileInfo

public GetXMLFileInfo()
Method Detail

getETag

public String getETag(ContentRequest req)
Specified by:
getETag in interface Cacheable

process

public void process(ContentRequest req,
                    XMLWriter xml)
             throws BerliozException,
                    IOException
Specified by:
process in interface ContentGenerator
Throws:
BerliozException
IOException