Package org.apache.uima.pear.tools

Examples of org.apache.uima.pear.tools.InstallationDescriptorHandler


   * @param installationDir
   *          The given installation directory.
   */
  private static void installPear(File localPearFile, File installationDir) {
    InstallationController.setLocalMode(true);
    InstallationDescriptorHandler installationDescriptorHandler = new InstallationDescriptorHandler();
    pearConsole.setText("");
    printInConsole(false, "");
    // check input parameters
    if (localPearFile != null && !localPearFile.exists()) {
      errorFlag = true;
      message = localPearFile.getAbsolutePath() + "file not found \n";
      printInConsole(errorFlag, message);
    } else {
      if (localPearFile != null) {
        pearConsole.append("PEAR file to install is => " + localPearFile.getAbsolutePath() + "\n");
      }
    }
    /* setting current working directory by default */
    if (installationDir == null) {
      installationDir = new File("./");
    }
    pearConsole.append("Installation directory is => " + installationDir.getAbsolutePath() + "\n");

    try {
      JarFile jarFile = new JarFile(localPearFile);
      installationDescriptorHandler.parseInstallationDescriptor(jarFile);
      insdObject = installationDescriptorHandler.getInstallationDescriptor();

      if (insdObject != null)
        mainComponentId = insdObject.getMainComponentId();

      else {
View Full Code Here


    String adjMainRoot = MAIN_ROOT + "/" + rootDir.getName();
    // 1st: process installation descriptor file
    File insdFile = new File(rootDir, InstallationProcessor.INSD_FILE_PATH);
    FileUtil.replaceStringInFile(insdFile, MAIN_ROOT_REGEX, adjMainRoot);
    // load installation descriptor
    InstallationDescriptorHandler insdHandler = new InstallationDescriptorHandler();
    try {
      insdHandler.parse(insdFile);
    } catch (Exception e) {
      throw new IOException(e.toString());
    }
    InstallationDescriptor insdObject = insdHandler.getInstallationDescriptor();
    // add installation descriptor file to 'find_and_replace_path' actions
    insdObject.addInstallationAction(createFileAction(adjMainRoot + "/"
            + InstallationProcessor.INSD_FILE_PATH, MAIN_ROOT));
    // 2nd: process files under 'desc' folder, if exists
    processFiles(rootDir, PackageBrowser.DESCRIPTORS_DIR, insdObject);
View Full Code Here

   * @param installationDir
   *          The given installation directory.
   */
  private static void installPear(File localPearFile, File installationDir) {
    InstallationController.setLocalMode(true);
    InstallationDescriptorHandler installationDescriptorHandler = new InstallationDescriptorHandler();
    pearConsole.setText("");
    printInConsole(false, "");
    // check input parameters
    if (localPearFile != null && !localPearFile.exists()) {
      errorFlag = true;
      message = localPearFile.getAbsolutePath() + "file not found \n";
      printInConsole(errorFlag, message);
    } else {
      if (localPearFile != null) {
        pearConsole.append("PEAR file to install is => " + localPearFile.getAbsolutePath() + "\n");
      }
    }
    /* setting current working directory by default */
    if (installationDir == null) {
      installationDir = new File("./");
    }
    pearConsole.append("Installation directory is => " + installationDir.getAbsolutePath() + "\n");

    try {
      JarFile jarFile = new JarFile(localPearFile);
      installationDescriptorHandler.parseInstallationDescriptor(jarFile);
      insdObject = installationDescriptorHandler.getInstallationDescriptor();

      if (insdObject != null)
        mainComponentId = insdObject.getMainComponentId();

      else {
View Full Code Here

   *
   */
  public static InstallationDescriptor getInstallationDescriptor(IContainer currentContainer)
          throws IOException, SAXException, CoreException, PearException {
    InstallationDescriptor insd = new InstallationDescriptor();
    InstallationDescriptorHandler insdh = new InstallationDescriptorHandler();
    IFile installFile = currentContainer.getFile(new Path(INSTALLATION_DESCRIPTOR_PATH));
    if (installFile.exists()) {
      insdh.parse(installFile.getContents());
      insd = insdh.getInstallationDescriptor();
    } else
      createInstallationDescriptor(currentContainer, insd, false);
    return insd;
  }
View Full Code Here

   *          The given installation directory.
   */
  private static void installPear(File localPearFile, File installationDir) {
  //System.out.println("installPear(\"" + localPearFile + "\", \"" + installationDir + "\")");
    InstallationController.setLocalMode(true);
    InstallationDescriptorHandler installationDescriptorHandler = new InstallationDescriptorHandler();
    printInConsole(false, "");
    // check input parameters
    if (localPearFile != null && !localPearFile.exists()) {
      errorFlag = true;
      message = localPearFile.getAbsolutePath() + "file not found \n";
      printInConsole(errorFlag, message);
    } else {
      if(localPearFile != null) {
        printInConsole(false, "PEAR file to install is => " + localPearFile.getAbsolutePath() + "\n");
      }
    }
    /* setting current working directory by default */
    if (installationDir == null) {
      installationDir = new File("./");
    }
    printInConsole(false,"Installation directory is => " + installationDir.getAbsolutePath() + "\n");

    try {
      JarFile jarFile = new JarFile(localPearFile);
      installationDescriptorHandler.parseInstallationDescriptor(jarFile);
      insdObject = installationDescriptorHandler.getInstallationDescriptor();

      if (insdObject != null)
        mainComponentId = insdObject.getMainComponentId();

      else {
View Full Code Here

   * @param installationDir
   *          The given installation directory.
   */
  private static void installPear(File localPearFile, File installationDir) {
    InstallationController.setLocalMode(true);
    InstallationDescriptorHandler installationDescriptorHandler = new InstallationDescriptorHandler();
    // check input parameters
    if (localPearFile != null && !localPearFile.exists()) {
      errorFlag = true;
      message = localPearFile.getAbsolutePath() + "file not found \n";
      printInConsole(errorFlag, message);
    }
    /* setting current working directory by default */
    if (installationDir == null) {
      installationDir = new File("./");
      pearConsole
              .append("installation directory is => " + installationDir.getAbsolutePath() + "\n");
    }
    try {
      JarFile jarFile = new JarFile(localPearFile);
      installationDescriptorHandler.parseInstallationDescriptor(jarFile);
      insdObject = installationDescriptorHandler.getInstallationDescriptor();

      if (insdObject != null)
        mainComponentId = insdObject.getMainComponentId();

      else {
View Full Code Here

   * @param installationDir
   *          The given installation directory.
   */
  private static void installPear(File localPearFile, File installationDir) {
    InstallationController.setLocalMode(true);
    InstallationDescriptorHandler installationDescriptorHandler = new InstallationDescriptorHandler();
    pearConsole.setText("");
    printInConsole(false, "");
    // check input parameters
    if (localPearFile != null && !localPearFile.exists()) {
      errorFlag = true;
      message = localPearFile.getAbsolutePath() + "file not found \n";
      printInConsole(errorFlag, message);
    } else {
      if(localPearFile != null) {
        pearConsole.append("PEAR file to install is => " + localPearFile.getAbsolutePath() + "\n");
      }
    }
    /* setting current working directory by default */
    if (installationDir == null) {
      installationDir = new File("./");
    }
    pearConsole.append("Installation directory is => " + installationDir.getAbsolutePath() + "\n");

    try {
      JarFile jarFile = new JarFile(localPearFile);
      installationDescriptorHandler.parseInstallationDescriptor(jarFile);
      insdObject = installationDescriptorHandler.getInstallationDescriptor();

      if (insdObject != null)
        mainComponentId = insdObject.getMainComponentId();

      else {
View Full Code Here

TOP

Related Classes of org.apache.uima.pear.tools.InstallationDescriptorHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.