Class ScriptLauncher

java.lang.Object
org.dspace.app.launcher.ScriptLauncher

public class ScriptLauncher extends Object
A DSpace script launcher.
Author:
Stuart Lewis, Mark Diggory
  • Method Details

    • main

      Execute the DSpace script launcher
      Parameters:
      args - Any parameters required to be passed to the scripts it executes
      Throws:
      IOException - if IO error
      FileNotFoundException - if file doesn't exist
      IllegalAccessException
      InstantiationException
    • handleScript

      public static int handleScript(String[] args, org.jdom2.Document commandConfigs, DSpaceRunnableHandler dSpaceRunnableHandler, DSpaceKernelImpl kernelImpl) throws InstantiationException, IllegalAccessException
      This method will take the arguments from a commandline input and it'll find the script that the first argument refers to and it'll execute this script. It can return a 1 or a 0 depending on whether the script failed or passed respectively
      Parameters:
      args - The arguments for the script and the script as first one in the array
      commandConfigs - The Document
      dSpaceRunnableHandler - The DSpaceRunnableHandler for this execution
      kernelImpl - The relevant DSpaceKernelImpl
      Returns:
      A 1 or 0 depending on whether the script failed or passed respectively
      Throws:
      InstantiationException
      IllegalAccessException
    • runOneCommand

      protected static int runOneCommand(org.jdom2.Document commandConfigs, String[] args)
    • runOneCommand

      protected static int runOneCommand(org.jdom2.Document commandConfigs, String[] args, DSpaceKernelImpl kernelImpl)
      Recognize and execute a single command.
      Parameters:
      commandConfigs - Document
      args - the command line arguments given
    • getConfig

      protected static org.jdom2.Document getConfig()
      Load the launcher configuration file
      Returns:
      The XML configuration file Document
    • getConfig

      public static org.jdom2.Document getConfig(DSpaceKernelImpl kernelImpl)