Class XMLNodesToFilesChecker

java.lang.Object
edu.ucsb.nceas.metacat.admin.upgrade.XMLNodesToFilesChecker

public class XMLNodesToFilesChecker extends Object
Historically, early versions of Metacat only store the metadata documents in the xml_nodes and xml_nodes_revsions tables rather than the files. Now, we drop the both tables in Metacat 3.0.0. This class is to make sure that all metadata objects have been serialized into the files.
Author:
tao
  • Constructor Details

    • XMLNodesToFilesChecker

      public XMLNodesToFilesChecker() throws edu.ucsb.nceas.utilities.PropertyNotFoundException, AdminException
      Default constructor
      Throws:
      edu.ucsb.nceas.utilities.PropertyNotFoundException
      AdminException
  • Method Details

    • check

      public void check() throws SQLException, IOException, edu.ucsb.nceas.utilities.PropertyNotFoundException, AdminException
      This method does the job - make sure all metadata object are stored in the files. Note: this method must be called before running the 3.0.0 upgrade sql script, which will drop the related tables.
      Throws:
      SQLException
      IOException
      edu.ucsb.nceas.utilities.PropertyNotFoundException
      AdminException
    • getFileName

      protected static String getFileName(String baseName)
      Get a file name concatenating the base name and current time.
      Parameters:
      baseName - the name will be appended by current time
      Returns:
      the file name concatenating the base name and current time.