Class MetadataImportCLI

  • All Implemented Interfaces:
    Runnable

    public class MetadataImportCLI
    extends MetadataImport
    CLI variant for the MetadataImport class This has been made so that we can specify the behaviour of the determineChanges method to be specific for the CLI
    • Constructor Detail

      • MetadataImportCLI

        public MetadataImportCLI()
    • Method Detail

      • determineChange

        protected boolean determineChange​(DSpaceRunnableHandler handler)
                                   throws IOException
        Description copied from class: MetadataImport
        This method determines whether the changes should be applied or not. This is default set to true for the REST script as we don't want to interact with the caller. This will be overwritten in the CLI script to ask for confirmation
        Overrides:
        determineChange in class MetadataImport
        Parameters:
        handler - Applicable DSpaceRunnableHandler
        Returns:
        boolean indicating the value
        Throws:
        IOException - If something goes wrong
      • assignCurrentUserInContext

        protected void assignCurrentUserInContext​(Context context)
                                           throws org.apache.commons.cli.ParseException
        Overrides:
        assignCurrentUserInContext in class MetadataImport
        Throws:
        org.apache.commons.cli.ParseException
      • setup

        public void setup()
                   throws org.apache.commons.cli.ParseException
        Description copied from class: DSpaceRunnable
        This method has to be included in every script and handles the setup of the script by parsing the CommandLine and setting the variables
        Overrides:
        setup in class MetadataImport
        Throws:
        org.apache.commons.cli.ParseException - If something goes wrong