dk.netarkivet.archive.arcrepository.bitpreservation
Enum WorkFiles

java.lang.Object
  extended by java.lang.Enum<WorkFiles>
      extended by dk.netarkivet.archive.arcrepository.bitpreservation.WorkFiles
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WorkFiles>

public enum WorkFiles
extends java.lang.Enum<WorkFiles>

This class encapsulates access to the files used in bitpreservation. The following files are encapsulated: "unsorted.txt": Unsorted list of files in a bitarchive "sorted.txt": Sorted list of files in a bitarchive "missingba.txt": Files that are missing in a bitarchive "missingadmindata.txt"; Files that are missing from admin data "wrongfiles.txt": Files with wrong checksum??? "referenceba.txt"; File list from reference ba? "wrongstates.txt"; Files that are in wrong state "insertinadmin.txt"; Files to insert into admin data "deletefromadmin.txt"; Files to delete from admin data "uploadtoba.txt"; Files to upload to the bitarchive "deletefromba.txt"; Files to delete from the bitarchive


Enum Constant Summary
CHECKSUMS_ON_BA
           
DELETE_FROM_ADMIN
           
DELETE_FROM_BA
           
FILES_ON_BA
           
FILES_ON_REFERENCE_BA
           
INSERT_IN_ADMIN
           
MISSING_FILES_ADMINDATA
           
MISSING_FILES_BA
           
UPLOAD_TO_BA
           
WRONG_FILES
           
WRONG_STATES
           
 
Method Summary
static java.io.File getFile(Location loc, WorkFiles fileType)
           
static java.util.Date getLastUpdate(Location loc, WorkFiles fileType)
           
static long getLineCount(Location loc, WorkFiles fileType)
           
static java.util.List<java.lang.String> getLines(Location institution, WorkFiles fileType)
           
(package private) static java.io.File getPreservationDir(Location institution)
          Get the base dir for all files related to bitpreservation for a given bitarchive
(package private) static java.io.File getSortedFile(java.io.File unsortedFile)
          Get a sorted file from an unsorted one, updating if necessary.
static void removeLine(Location loc, WorkFiles fileType, java.lang.String line)
           
static WorkFiles valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WorkFiles[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
static void write(Location institution, WorkFiles missingFilesBa, java.util.Set<java.lang.String> files)
           
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MISSING_FILES_BA

public static final WorkFiles MISSING_FILES_BA

MISSING_FILES_ADMINDATA

public static final WorkFiles MISSING_FILES_ADMINDATA

WRONG_FILES

public static final WorkFiles WRONG_FILES

FILES_ON_REFERENCE_BA

public static final WorkFiles FILES_ON_REFERENCE_BA

INSERT_IN_ADMIN

public static final WorkFiles INSERT_IN_ADMIN

DELETE_FROM_ADMIN

public static final WorkFiles DELETE_FROM_ADMIN

UPLOAD_TO_BA

public static final WorkFiles UPLOAD_TO_BA

DELETE_FROM_BA

public static final WorkFiles DELETE_FROM_BA

WRONG_STATES

public static final WorkFiles WRONG_STATES

FILES_ON_BA

public static final WorkFiles FILES_ON_BA

CHECKSUMS_ON_BA

public static final WorkFiles CHECKSUMS_ON_BA
Method Detail

values

public static final WorkFiles[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(WorkFiles c : WorkFiles.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static WorkFiles valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getPreservationDir

static java.io.File getPreservationDir(Location institution)
Get the base dir for all files related to bitpreservation for a given bitarchive

Parameters:
institution - The name of a bitarchive.
Returns:
The directory to place bitpreservation for the archive under.

getSortedFile

static java.io.File getSortedFile(java.io.File unsortedFile)
Get a sorted file from an unsorted one, updating if necessary.

Parameters:
unsortedFile - An unsorted file
Returns:
A file that contains the same lines as unsortedFile, but sorted. The file will be placed in the same directory as the input file, but have the name Constants.SORTED_OUTPUT_FILE defines.

write

public static void write(Location institution,
                         WorkFiles missingFilesBa,
                         java.util.Set<java.lang.String> files)

getFile

public static java.io.File getFile(Location loc,
                                   WorkFiles fileType)

getLastUpdate

public static java.util.Date getLastUpdate(Location loc,
                                           WorkFiles fileType)

getLineCount

public static long getLineCount(Location loc,
                                WorkFiles fileType)

removeLine

public static void removeLine(Location loc,
                              WorkFiles fileType,
                              java.lang.String line)

getLines

public static java.util.List<java.lang.String> getLines(Location institution,
                                                        WorkFiles fileType)