public class W3CWidgetFactory
extends java.lang.Object
To use the factory you MUST supply a valid output directory into which the Factory will unpack the widget. Other factory properties are optional.
Factory properties:
| Constructor and Description |
|---|
W3CWidgetFactory() |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
getUnzippedWidgetDirectory() |
W3CWidget |
parse(java.io.File zipFile)
Parse a given ZipFile and return a W3CWidget object representing the processed information in the package.
|
W3CWidget |
parse(java.io.File zipFile,
java.lang.String defaultIdentifier)
Parse a given ZipFile and return a W3CWidget object representing the processed information in the package.
|
W3CWidget |
parse(java.net.URL url)
Parse a widget at a given URL and return a W3CWidget object representing the processed information in the package.
|
W3CWidget |
parse(java.net.URL url,
boolean ignoreContentType)
Parse a widget at a given URL and return a W3CWidget object representing the processed information in the package.
|
W3CWidget |
parse(java.net.URL url,
boolean ignoreContentType,
java.lang.String defaultIdentifier)
Parse a widget at a given URL and return a W3CWidget object representing the processed information in the package.
|
void |
setDigitalSignatureParser(IDigitalSignatureProcessor digitalSignatureParser) |
void |
setEncodings(java.lang.String[] encodings) |
void |
setFeatures(java.lang.String[] features)
Set the features to be included when parsing widgets
|
void |
setLocales(java.lang.String[] locales)
Set the supported locales to be used when parsing widgets
|
void |
setLocalPath(java.lang.String localPath)
Set the base URL to use
|
void |
setOutputDirectory(java.lang.String outputDirectory)
Set the directory to use to save widgets.
|
void |
setStartPageProcessor(IStartPageProcessor startPageProcessor)
Set the start page processor to use when parsing widgets
|
public void setFeatures(java.lang.String[] features)
features - public void setOutputDirectory(java.lang.String outputDirectory)
throws java.io.IOException
outputDirectory - java.io.IOException - if the directory does not existpublic void setStartPageProcessor(IStartPageProcessor startPageProcessor)
startPageProcessor - public void setDigitalSignatureParser(IDigitalSignatureProcessor digitalSignatureParser)
public void setLocales(java.lang.String[] locales)
locales - public void setLocalPath(java.lang.String localPath)
localPath - java.lang.Exceptionpublic W3CWidget parse(java.io.File zipFile) throws java.lang.Exception, BadWidgetZipFileException, BadManifestException
zipFile - BadWidgetZipFileException - if there is a problem with the zip packageBadManifestException - if there is a problem with the config.xml manifest file in the packagejava.lang.Exceptionpublic W3CWidget parse(java.io.File zipFile, java.lang.String defaultIdentifier) throws java.lang.Exception, BadWidgetZipFileException, BadManifestException
zipFile - defaultIdentifier - a default identifier to use if the widget package does not have an identifierBadWidgetZipFileException - if there is a problem with the zip packageBadManifestException - if there is a problem with the config.xml manifest file in the packagejava.lang.Exceptionpublic W3CWidget parse(java.net.URL url) throws BadWidgetZipFileException, BadManifestException, InvalidContentTypeException, java.io.IOException, java.lang.Exception
url - BadWidgetZipFileException - if there is a problem with the zip packageBadManifestException - if there is a problem with the config.xml manifest file in the packageInvalidContentTypeException - if the widget has an invalid content typejava.io.IOException - if the widget cannot be downloadedjava.lang.Exceptionpublic W3CWidget parse(java.net.URL url, boolean ignoreContentType) throws BadWidgetZipFileException, BadManifestException, InvalidContentTypeException, java.io.IOException, java.lang.Exception
url - ignoreContentType - set to true to instruct the parser to ignore invalid content type exceptionsBadWidgetZipFileException - if there is a problem with the zip packageBadManifestException - if there is a problem with the config.xml manifest file in the packageInvalidContentTypeException - if the widget has an invalid content typejava.io.IOException - if the widget cannot be downloadedjava.lang.Exceptionpublic W3CWidget parse(java.net.URL url, boolean ignoreContentType, java.lang.String defaultIdentifier) throws BadWidgetZipFileException, BadManifestException, InvalidContentTypeException, java.io.IOException, java.lang.Exception
url - ignoreContentType - set to true to instruct the parser to ignore invalid content type exceptionsdefaultIdentifier - an identifier to use if the downloaded widget has no identifier - for example when updating a widgetBadWidgetZipFileException - if there is a problem with the zip packageBadManifestException - if there is a problem with the config.xml manifest file in the packageInvalidContentTypeException - if the widget has an invalid content typejava.io.IOException - if the widget cannot be downloadedjava.lang.Exceptionpublic void setEncodings(java.lang.String[] encodings)
throws java.lang.Exception
java.lang.Exceptionpublic java.io.File getUnzippedWidgetDirectory()
2012 Apache Software Foundation.