Class PearInstallationDescriptor

java.lang.Object
org.apache.uima.pear.insd.edit.PearInstallationDescriptor

public class PearInstallationDescriptor extends Object
Handles the PEAR installation descriptor (install.xml)
  • Field Details

    • INSTALLATION_DESCRIPTOR_PATH

      public static final String INSTALLATION_DESCRIPTOR_PATH
      The Constant INSTALLATION_DESCRIPTOR_PATH.
      See Also:
  • Constructor Details

    • PearInstallationDescriptor

      public PearInstallationDescriptor()
  • Method Details

    • saveInstallationDescriptor

      public static void saveInstallationDescriptor(org.eclipse.core.resources.IContainer currentContainer, InstallationDescriptor insd) throws org.eclipse.core.runtime.CoreException, IOException
      Save installation descriptor.
      Parameters:
      currentContainer - An IProject with the UIMA nature
      insd - The installation descriptor object
      Throws:
      org.eclipse.core.runtime.CoreException - if there is problem accessing the corresponding resource
      IOException - if there is problem writing to the corresponding resource
    • getInstallationDescriptor

      public static InstallationDescriptor getInstallationDescriptor(org.eclipse.core.resources.IContainer currentContainer) throws IOException, SAXException, org.eclipse.core.runtime.CoreException, PearException
      Returns an InstallationDescriptor instance representing the installation descriptor of the given project. If not existent, it return and empty InstallationDescriptor instance.
      Parameters:
      currentContainer - An IProject with the UIMa Nature
      Returns:
      InstallationDescriptor The Installation descriptor object
      Throws:
      IOException - if there is problem writing to the xml file of the installation descriptor
      SAXException - if there is problem parsing the xml of the installation descriptor
      org.eclipse.core.runtime.CoreException - if there is problem with resources
      PearException - if there is problem with PEAR related operations
    • createInstallationDescriptor

      public static void createInstallationDescriptor(org.eclipse.core.resources.IContainer newContainer, InstallationDescriptor insd, boolean overrideContentIfExist) throws PearException
      Create the PEAR installation descriptor file (install.xml) using a given InstallationDescriptor instance.
      Parameters:
      newContainer - An IProject with the UIMA nature
      insd - an instance of Installationdescriptor
      overrideContentIfExist - if true overrides any existing install.xml
      Throws:
      PearException - If a problem occurs.
    • addMacro

      public static String addMacro(String s)
      adds the $main_root/ macro as a prefix to the given string.
      Parameters:
      s - a String representing a relative path to the project root
      Returns:
      The String with the macro