for(int k=0; k<children.getLength(); k++)
{
Node archiveNode = children.item(k);
NodeList archiveNodeChildren = archiveNode.getChildNodes();
Archive archive = new Archive();
boolean propertySet = false;
NamedNodeMap attributes = archiveNode.getAttributes();
if(attributes!=null)
{
for(int j=0; j<attributes.getLength(); j++)
{
Node attribute = attributes.item(j);
if(Archive.OS.equals(attribute.getNodeName()))
{
archive.setOs(attribute.getTextContent());
propertySet = true;
}
else if(Archive.ARCH.equals(attribute.getNodeName()))
{
archive.setArchitecture(attribute.getTextContent());
propertySet = true;
}
}
}
for(int i=0; i<archiveNodeChildren.getLength(); i++)
{
Node node = archiveNodeChildren.item(i);
if(Archive.CHECKSUM.equals(node.getNodeName()))
{
archive.setChecksum(node.getTextContent());
archive.setChecksumType(node.getAttributes().getNamedItem(Archive.TYPE).getTextContent());
propertySet = true;
}
else if(Archive.SIZE.equals(node.getNodeName()))
{
String value = node.getTextContent();
if(value!=null)
{
archive.setSize(Integer.valueOf(value));
propertySet = true;
}
}
if(Archive.URL.equals(node.getNodeName()))
{
archive.setUrl(node.getTextContent());
propertySet = true;
}
}
if(propertySet)