edu.uiuc.ndiipp.hubandspoke.profile
Class HaSMETSProfileFactory

java.lang.Object
  extended by edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfileFactory

public class HaSMETSProfileFactory
extends java.lang.Object

This class contains static methods for instantiating through various means HaSMETSProfile instances or subclasses.

Author:
thabing

Constructor Summary
HaSMETSProfileFactory()
           
 
Method Summary
static void main(java.lang.String[] args)
          Perform basic functions from the command line like unzip or validate
static HaSMETSProfile newHaSMETSProfile()
          Create a new instance of a HaSMETSProfile object with a PackageType of AIP
static HaSMETSProfile newHaSMETSProfile(METSProfile.PackageType pt)
          Create a new instance of a HaSMETSProfile object
static HaSMETSWebProfile newHaSMETSWebProfile()
          Create a new instance of a HaSMETSWebProfile object with a package type of AIP
static HaSMETSWebProfile newHaSMETSWebProfile(METSProfile.PackageType pt)
          Create a new instance of a HaSMETSWebProfile object
static HaSMETSProfile newInstance(java.io.File f)
          Create a new HaSMETSProfile object or one of its subclasses from the XML file .
static HaSMETSProfile newInstance(java.io.File f, METSProfile.PackageType pt)
          Create a new HaSMETSProfile object or one of its subclasses from the XML file .
static HaSMETSProfile newInstance(java.lang.String filepath)
          Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given file path.
static HaSMETSProfile newInstance(java.lang.String filepath, METSProfile.PackageType pt)
          Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given file path.
static HaSMETSProfile newInstance(java.net.URL url)
          Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given URL.
static HaSMETSProfile newInstance(java.net.URL url, METSProfile.PackageType pt)
          Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given URL.
static HaSMETSProfile newInstance(java.util.zip.ZipFile zip, boolean overWrite)
          Create a new HaSMETSProfile object or one of its subclasses from the files contained in the given ZipFile.
static HaSMETSProfile newInstance(java.util.zip.ZipFile zip, boolean overWrite, METSProfile.PackageType pt)
          Create a new HaSMETSProfile object or one of its subclasses from the files contained in the given ZipFile.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HaSMETSProfileFactory

public HaSMETSProfileFactory()
Method Detail

main

public static void main(java.lang.String[] args)
Perform basic functions from the command line like unzip or validate

Parameters:
args -

newHaSMETSProfile

public static HaSMETSProfile newHaSMETSProfile(METSProfile.PackageType pt)
Create a new instance of a HaSMETSProfile object

Parameters:
pt - the PackageType of the newly created package
Returns:
a new HaSMETSProfile instance

newHaSMETSProfile

public static HaSMETSProfile newHaSMETSProfile()
Create a new instance of a HaSMETSProfile object with a PackageType of AIP

Returns:
a new HaSMETSProfile instance

newHaSMETSWebProfile

public static HaSMETSWebProfile newHaSMETSWebProfile(METSProfile.PackageType pt)
Create a new instance of a HaSMETSWebProfile object

Parameters:
pt - the package type of the newly created package
Returns:
a new HaSMETSWebProfile instance

newHaSMETSWebProfile

public static HaSMETSWebProfile newHaSMETSWebProfile()
Create a new instance of a HaSMETSWebProfile object with a package type of AIP

Returns:
a new HaSMETSWebProfile instance

newInstance

public static HaSMETSProfile newInstance(java.net.URL url,
                                         METSProfile.PackageType pt)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given URL. The class returned depends on the PROFILE attribute of the METS file

Parameters:
url - the URL to the XML METS file to load
pt - PackageType
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.net.URL url)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given URL. The class returned depends on the PROFILE attribute of the METS file

Parameters:
url - the URL to the XML METS file to load
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.lang.String filepath,
                                         METSProfile.PackageType pt)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given file path. The class returned depends on the PROFILE attribute of the METS file

Parameters:
filepath - the file path to the XML METS file to load
pt - PackageType
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.lang.String filepath)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the XML file at the given file path. The class returned depends on the PROFILE attribute of the METS file

Parameters:
filepath - the file path to the XML METS file to load
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.io.File f,
                                         METSProfile.PackageType pt)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the XML file . The class returned depends on the PROFILE attribute of the METS file

Parameters:
f - the file containing XML METS file to load
pt - the PackageType of the new package
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.io.File f)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the XML file . The class returned depends on the PROFILE attribute of the METS file

Parameters:
f - the file containing XML METS file to load
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.util.zip.ZipFile zip,
                                         boolean overWrite,
                                         METSProfile.PackageType pt)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the files contained in the given ZipFile. The zip file is unzipped into the same directory as the zipfile itself. If there already files in this directory they will not be overwritten, and n error will result. The class returned depends on the PROFILE attribute of the METS file. There is assumed to be a file in the root directory of the zip file called echodepmets.xml or just mets.xml. This method looks for filenames which would be duplicates on a system which treats filenames as case-insensitive (Windows), and it will rename these files as appropriate. Note that directory names are not renamed, so for example if there are files Test/file.txt and test/file.txt they will end up in the same directory, but with different file names, like Test/file.txt and Test/file_1.txt

Parameters:
zip -
overWrite -
pt -
Throws:
HaSMETSProfileException

newInstance

public static HaSMETSProfile newInstance(java.util.zip.ZipFile zip,
                                         boolean overWrite)
                                  throws HaSMETSProfileException
Create a new HaSMETSProfile object or one of its subclasses from the files contained in the given ZipFile.

Parameters:
zip -
overWrite -
Throws:
HaSMETSProfileException


Copyright © 2006, University of Illinois.