| java.lang.Object com.izforge.izpack.installer.WebRepositoryAccessor
WebRepositoryAccessor | public class WebRepositoryAccessor (Code) | | This class enumerates the availabe packs at the web repository. Parses the config files
- install.xml, packsinfo.xml, langpacks and is used to override the static configuration
in the installer jar.
author: Vladimir Ralev version: $Revision: 1.1 $ |
Method Summary | |
public static String | getCachedUrl(String url, String tempFolder) First download the jar file. | public ArrayList<PackInfo> | getOnlinePacks() | protected ArrayList<PackInfo> | loadPacksList(XMLElement data) | protected void | parseError(String message) Create parse error with consistent messages. | protected void | parseError(XMLElement parent, String message) Create parse error with consistent messages. | protected void | parseError(XMLElement parent, String message, Throwable cause) Create a chained parse error with consistent messages. | protected void | parseWarn(XMLElement parent, String message) Create a parse warning with consistent messages. | protected String | requireAttribute(XMLElement element, String attribute) Call getAttribute on an element, producing a meaningful error message if not present, or
empty. | protected XMLElement | requireChildNamed(XMLElement parent, String name) Call getFirstChildNamed on the parent, producing a meaningful error message on failure. | protected String | requireContent(XMLElement element) Call getContent on an element, producing a meaningful error message if not present, or empty. | protected int | requireIntAttribute(XMLElement element, String attribute) Get a required attribute of an element, ensuring it is an integer. | protected URL | requireURLContent(XMLElement element) Call getContent on an element, producing a meaningful error message if not present, or empty,
or a valid URL. | protected boolean | requireYesNoAttribute(XMLElement element, String attribute) Call getAttribute on an element, producing a meaningful error message if not present, or one
of "yes" or "no". | protected boolean | validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue) Call getAttribute on an element, producing a meaningful warning if not "yes" or "no". |
WebRepositoryAccessor | public WebRepositoryAccessor(String urlbase)(Code) | | Create a new WebRepositoryAccessor.
Parameters: urlbase - |
getCachedUrl | public static String getCachedUrl(String url, String tempFolder) throws Exception(Code) | | First download the jar file. The create the input stream from the
downloaded file. This is because the Jar connection's openInputStream
will blocks until the whole jar in order to unzip it (there is no way
to see the download progress there).
Parameters: url - the url |
getOnlinePacks | public ArrayList<PackInfo> getOnlinePacks()(Code) | | Get the list of the packs from the remore install.xml
the packs list |
parseError | protected void parseError(String message) throws CompilerException(Code) | | Create parse error with consistent messages. Includes file name. For use When parent is
unknown.
Parameters: message - Brief message explaining error |
parseError | protected void parseError(XMLElement parent, String message) throws CompilerException(Code) | | Create parse error with consistent messages. Includes file name and line # of parent. It is
an error for 'parent' to be null.
Parameters: parent - The element in which the error occured Parameters: message - Brief message explaining error |
parseError | protected void parseError(XMLElement parent, String message, Throwable cause) throws CompilerException(Code) | | Create a chained parse error with consistent messages. Includes file name and line # of
parent. It is an error for 'parent' to be null.
Parameters: parent - The element in which the error occured Parameters: message - Brief message explaining error |
parseWarn | protected void parseWarn(XMLElement parent, String message)(Code) | | Create a parse warning with consistent messages. Includes file name and line # of parent. It
is an error for 'parent' to be null.
Parameters: parent - The element in which the warning occured Parameters: message - Warning message |
requireAttribute | protected String requireAttribute(XMLElement element, String attribute) throws CompilerException(Code) | | Call getAttribute on an element, producing a meaningful error message if not present, or
empty. It is an error for 'element' or 'attribute' to be null.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get |
requireChildNamed | protected XMLElement requireChildNamed(XMLElement parent, String name) throws CompilerException(Code) | | Call getFirstChildNamed on the parent, producing a meaningful error message on failure. It is
an error for 'parent' to be null.
Parameters: parent - The element to search for a child Parameters: name - Name of the child element to get |
requireContent | protected String requireContent(XMLElement element) throws CompilerException(Code) | | Call getContent on an element, producing a meaningful error message if not present, or empty.
It is an error for 'element' to be null.
Parameters: element - The element to get content of |
requireIntAttribute | protected int requireIntAttribute(XMLElement element, String attribute) throws CompilerException(Code) | | Get a required attribute of an element, ensuring it is an integer. A meaningful error message
is generated as a CompilerException if not present or parseable as an int. It is an error for
'element' or 'attribute' to be null.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get |
requireURLContent | protected URL requireURLContent(XMLElement element) throws CompilerException(Code) | | Call getContent on an element, producing a meaningful error message if not present, or empty,
or a valid URL. It is an error for 'element' to be null.
Parameters: element - The element to get content of |
requireYesNoAttribute | protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException(Code) | | Call getAttribute on an element, producing a meaningful error message if not present, or one
of "yes" or "no". It is an error for 'element' or 'attribute' to be null.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get |
validateYesNoAttribute | protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue)(Code) | | Call getAttribute on an element, producing a meaningful warning if not "yes" or "no". If the
'element' or 'attribute' are null, the default value is returned.
Parameters: element - The element to get the attribute value of Parameters: attribute - The name of the attribute to get Parameters: defaultValue - Value returned if attribute not present or invalid |
|
|