org.weborganic.ox.core
Class PackageData

java.lang.Object
  extended by org.weborganic.ox.core.PackageData
All Implemented Interfaces:
XMLWritable

public class PackageData
extends Object
implements XMLWritable

Represents an abstract data package

Version:
29 October
Author:
Christophe Lauret

Method Summary
 Date created()
           
 File directory()
           
 File findByExtension(String extension)
           
 File findDOCX()
          Deprecated. 
 File getDownloadDir(File download)
           
 File getFile(String path)
           
 File getOriginal()
           
static PackageData getPackageData(String id)
           
 String getParameter(String name)
           
 Map<String,String> getParameters()
           
 String getProperty(String name)
           
 String getProperty(String name, String fallback)
           
 String id()
           
 boolean inspect()
          Inspect the package
 boolean isUnpacked()
          Indicates whether the package contains an unpacked directory.
 boolean loadProperties()
           
static PackageData newPackageData(String model)
          Creates new package data.
 boolean saveProperties()
          Saves the properties of this packages data in the file system.
 void setParameter(String name, String value)
           
 void setProperty(String name, String value)
           
 void toXML(XMLWriter xml)
           
 boolean unpack()
          Find the DOCX document and unpack its content if necessary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

created

public Date created()

id

public String id()

directory

public File directory()

getFile

public File getFile(String path)

findDOCX

@Deprecated
public File findDOCX()
Deprecated. 


findByExtension

public File findByExtension(String extension)

getOriginal

public File getOriginal()

isUnpacked

public boolean isUnpacked()
Indicates whether the package contains an unpacked directory.

Returns:
true the package contains an unpacked directory; false otherwise.

setParameter

public void setParameter(String name,
                         String value)
Parameters:
name -

getParameter

public String getParameter(String name)
Parameters:
name -
Returns:

getParameters

public Map<String,String> getParameters()
Parameters:
name -
Returns:

getProperty

public String getProperty(String name)

getProperty

public String getProperty(String name,
                          String fallback)

setProperty

public void setProperty(String name,
                        String value)

loadProperties

public boolean loadProperties()
Returns:

saveProperties

public boolean saveProperties()
Saves the properties of this packages data in the file system.

Returns:

inspect

public boolean inspect()
                throws IOException
Inspect the package

Returns:
Throws:
IOException

unpack

public boolean unpack()
               throws IOException
Find the DOCX document and unpack its content if necessary

Returns:
Throws:
IOException

toXML

public void toXML(XMLWriter xml)
           throws IOException
Specified by:
toXML in interface XMLWritable
Throws:
IOException

getDownloadDir

public File getDownloadDir(File download)

newPackageData

public static PackageData newPackageData(String model)
Creates new package data.

Returns:

getPackageData

public static PackageData getPackageData(String id)