org.jdesktop.wonderland.common.checksums
Class ChecksumList

java.lang.Object
  extended by org.jdesktop.wonderland.common.checksums.ChecksumList

public class ChecksumList
extends java.lang.Object

The ChecksumList class represents a collection of checkums.

This class uses JAXB to encode/decode the class to/from XML, either on disk or over the network

Author:
paulby, Jordan Slott

Field Summary
 java.util.LinkedList<Checksum> checksumList
           
 java.util.Map<java.lang.String,Checksum> internalChecksums
           
static java.lang.String SHA1_CHECKSUM_ALGORITHM
           
 
Constructor Summary
ChecksumList()
          Default constructor
 
Method Summary
static ChecksumList decode(java.io.Reader r)
          Takes the input reader of the XML file and instantiates an instance of the ChecksumList class
 void encode(java.io.Writer w)
          Writes the ChecksumList class to an output writer.
 Checksum getChecksum(java.lang.String assetPath)
          Returns the checksum for the given asset path, null if none exists.
 java.util.Map<java.lang.String,Checksum> getChecksumMap()
          Returns a copy of the map of checksums
 void putChecksum(Checksum checksum)
          Puts a single checksum into the list
 void putChecksums(java.util.Map<java.lang.String,Checksum> checksumMap)
          Takes a map of checksums and puts it in this map, overwriting any existing entries.
 void setChecksums(java.util.Map<java.lang.String,Checksum> checksumMap)
          Sets the array of individual checksums.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHA1_CHECKSUM_ALGORITHM

public static final java.lang.String SHA1_CHECKSUM_ALGORITHM
See Also:
Constant Field Values

checksumList

public java.util.LinkedList<Checksum> checksumList

internalChecksums

public java.util.Map<java.lang.String,Checksum> internalChecksums
Constructor Detail

ChecksumList

public ChecksumList()
Default constructor

Method Detail

setChecksums

public void setChecksums(java.util.Map<java.lang.String,Checksum> checksumMap)
Sets the array of individual checksums.

Parameters:
checksumMap - A map of Checksum objects

getChecksumMap

public java.util.Map<java.lang.String,Checksum> getChecksumMap()
Returns a copy of the map of checksums

Returns:
A Map of asset path and checksums

getChecksum

public Checksum getChecksum(java.lang.String assetPath)
Returns the checksum for the given asset path, null if none exists.

Parameters:
asestPath - The path to the asset
Returns:
The Checksum for the asset

putChecksum

public void putChecksum(Checksum checksum)
Puts a single checksum into the list

Parameters:
checksum - The Checksum to place into the list

putChecksums

public void putChecksums(java.util.Map<java.lang.String,Checksum> checksumMap)
Takes a map of checksums and puts it in this map, overwriting any existing entries.

Parameters:
checksumMap - A map of Checksums objects to add

decode

public static ChecksumList decode(java.io.Reader r)
                           throws javax.xml.bind.JAXBException
Takes the input reader of the XML file and instantiates an instance of the ChecksumList class

Parameters:
r - The input reader of the version XML file
Throws:
javax.xml.bind.JAXBException

encode

public void encode(java.io.Writer w)
            throws javax.xml.bind.JAXBException
Writes the ChecksumList class to an output writer.

Parameters:
w - The output writer to write to
Throws:
javax.xml.bind.JAXBException


Open Wonderland - http://openwonderland.org