Package org.pentaho.packageManagement

Examples of org.pentaho.packageManagement.Package


    String packageName = m_table.getValueAt(i,
        getColumnIndex(PACKAGE_COLUMN)).toString();

    boolean repositoryPackage = true;
    try {
      Package repP = WekaPackageManager.getRepositoryPackageInfo(packageName);
    } catch (Exception ex) {
      repositoryPackage = false;
    }
    String versionURL = WekaPackageManager.getPackageRepositoryURL().toString()
      + "/" + packageName + "/index.html";
   
    try {
      URL back = m_infoPane.getPage();
      if (m_browserHistory.size() == 0 && back != null) {
        m_backB.setEnabled(true);
      }
      if (back != null) {
        m_browserHistory.add(back);
      }
     
      if (repositoryPackage) {
        m_infoPane.setPage(new URL(versionURL));
      } else {
        // try and display something on this non-official package
        try {
          Package p = WekaPackageManager.getInstalledPackageInfo(packageName);
          Map<?, ?> meta = p.getPackageMetaData();
          Set<?> keys = meta.keySet();
          StringBuffer sb = new StringBuffer();
          sb.append(weka.core.RepositoryIndexGenerator.HEADER);
          sb.append("<H1>" + packageName + " (Unofficial) </H1>");
          for (Object k : keys) {
View Full Code Here


      m_allBut.setEnabled(false);
      m_installedBut.setEnabled(false);
      ProgressPrintStream pps = new ProgressPrintStream(this);
      m_progress.setMaximum(30);
     
      Package installedPackage = null;
      String toInstall = m_target;
      try {
        toInstall = Environment.getSystemWide().substitute(m_target);
      } catch (Exception ex) {}
     
      try {
        if (toInstall.toLowerCase().startsWith("http://") ||
            toInstall.toLowerCase().startsWith("https://")) {
          String packageName =
            WekaPackageManager.installPackageFromURL(new URL(toInstall), pps);
          installedPackage = WekaPackageManager.getInstalledPackageInfo(packageName);
        } else if (toInstall.toLowerCase().endsWith(".zip")){
          String packageName = WekaPackageManager.installPackageFromArchive(toInstall, pps);
          installedPackage = WekaPackageManager.getInstalledPackageInfo(packageName);
        } else {
          displayErrorDialog("Unable to install package " +
              "\nfrom " + toInstall + ". Unrecognized as a URL or zip archive.",
              (String)null);
          m_errorOccurred = true;
          return null;
        }
      } catch (Exception ex) {
        displayErrorDialog("Unable to install package " +
            "\nfrom " + m_target + ". Check the log for error messages.",
             ex);
        m_errorOccurred = true;
        return null;
      }
     
      if (installedPackage != null) {
        try {       
          File packageRoot =
            new File(WekaPackageManager.getPackageHome() + File.separator
                + installedPackage.getName());
          boolean loadCheck  =
            WekaPackageManager.loadCheck(installedPackage, packageRoot, pps);
         
          if (!loadCheck) {
            displayErrorDialog("Package was installed correctly but could not " +
View Full Code Here

      m_installedBut.setEnabled(false);
      ProgressPrintStream pps = new ProgressPrintStream(this);
      m_progress.setMaximum(m_packageNamesToInstall.size() * 30);

      for (int zz = 0; zz < m_packageNamesToInstall.size(); zz++) {
        Package packageToInstall = null;
        String packageName = m_packageNamesToInstall.get(zz);
        Object versionToInstall = m_versionsToInstall.get(zz);
        try {
          packageToInstall = WekaPackageManager.getRepositoryPackageInfo(packageName,
             versionToInstall.toString());
        } catch (Exception e) {
          e.printStackTrace();
          displayErrorDialog("Unable to obtain package info for package: "
              + packageName, e);
//          return null; // bail out here
          m_unsuccessfulInstalls.add(packageToInstall);
          continue;
        }

        // check for any special installation instructions
        Object specialInstallMessage =
          packageToInstall.getPackageMetaDataElement("MessageToDisplayOnInstallation");
        if (specialInstallMessage != null &&
            specialInstallMessage.toString().length() > 0) {
          String siM = specialInstallMessage.toString();
          try {
            siM = Environment.getSystemWide().substitute(siM);
          } catch (Exception ex) {
            // quietly ignore
          }
          JOptionPane.showMessageDialog(PackageManager.this,
              packageToInstall + "\n\n" + siM,
              "Weka Package Manager", JOptionPane.OK_OPTION);
        }

        if (!m_forceBut.isSelected()) {
          try {
            if (!packageToInstall.isCompatibleBaseSystem()) {
              List<Dependency> baseSysDep = packageToInstall.getBaseSystemDependency();
              StringBuffer depList = new StringBuffer();
              for (Dependency bd : baseSysDep) {
                depList.append(bd.getTarget().toString() + " ");
              }

              JOptionPane.showMessageDialog(PackageManager.this, "Unable to install package " +
                  "\n" + packageName + " because it requires" +
                  "\n" + depList.toString(),
                  "Weka Package Manager", JOptionPane.ERROR_MESSAGE);
              // bail out here
              //return null;
              m_unsuccessfulInstalls.add(packageToInstall);
              continue;
            }                   
          } catch (Exception e) {
            e.printStackTrace();
            displayErrorDialog("Problem determining dependency on base system" +
                " for package: " + packageName, e);
            //return null; // can't proceed
            m_unsuccessfulInstalls.add(packageToInstall);
            continue;
          }

          // check to see if package is already installed
          boolean upOrDowngrading = false;
          if (packageToInstall.isInstalled()) {
            Package installedVersion = null;
            try {
              installedVersion = WekaPackageManager.getInstalledPackageInfo(packageName);
            } catch (Exception e) {
              e.printStackTrace();
              displayErrorDialog("Problem obtaining package info for package: "
                  + packageName, e);
              //return null; // can't proceed
              m_unsuccessfulInstalls.add(packageToInstall);
              continue;
            }

            if (!packageToInstall.equals(installedVersion)) {
              int result = JOptionPane.showConfirmDialog(PackageManager.this, "Package " +
                  installedVersion + " is already installed. Replace with " +
                  packageToInstall + "?", "Weka Package Manager", JOptionPane.YES_NO_OPTION);
              if (result == JOptionPane.NO_OPTION) {
                // bail out here
                //return null;
                m_unsuccessfulInstalls.add(packageToInstall);
                continue;
              }

              if (!Utils.getDontShowDialog("weka.gui.PackageManager.RestartAfterUpgrade")) {
                JCheckBox dontShow = new JCheckBox("Do not show this message again");
                Object[] stuff = new Object[2];
                stuff[0] = "Weka will need to be restared after installation for\n" +
                "the changes to come into effect.\n";
                stuff[1] = dontShow;

                JOptionPane.showMessageDialog(PackageManager.this, stuff,
                    "Weka Package Manager", JOptionPane.OK_OPTION);

                if (dontShow.isSelected()) {
                  try {
                    Utils.setDontShowDialog("weka.gui.PackageManager.RestartAfterUpgrade");
                  } catch (Exception ex) {
                    // quietly ignore
                  }
                }
              }
            } else {
              int result = JOptionPane.showConfirmDialog(PackageManager.this, "Package " +
                  installedVersion + " is already installed. Install again?",
                  "Weka Package Manager", JOptionPane.YES_NO_OPTION);
              if (result == JOptionPane.NO_OPTION) {
                // bail out here
                //return null;
                m_unsuccessfulInstalls.add(packageToInstall);
                continue;
              }
            }                   
          }


          // Now get a full list of dependencies for this package and
          // check for any conflicts
          Map<String, List<Dependency>> conflicts = new HashMap<String, List<Dependency>>();
          List<Dependency> dependencies = null;
          try {         
            dependencies =
              WekaPackageManager.getAllDependenciesForPackage(packageToInstall, conflicts);
          } catch (Exception e) {
            e.printStackTrace();
            displayErrorDialog("Problem determinining dependencies for package: "
                + packageToInstall.getName(), e);
            //return null; // can't proceed
            m_unsuccessfulInstalls.add(packageToInstall);
            continue;
          }

          if (conflicts.size() > 0) {
            StringBuffer message = new StringBuffer();
            message.append("Package " + packageName + " requires the following packages:\n\n");
            Iterator<Dependency> depI = dependencies.iterator();
            while (depI.hasNext()) {
              Dependency d = depI.next();
              message.append("\t" + d +"\n");
            }

            message.append("\nThere are conflicting dependencies:\n\n");
            Set<String> pNames = conflicts.keySet();
            Iterator<String> pNameI = pNames.iterator();
            while (pNameI.hasNext()) {
              String pName = pNameI.next();
              message.append("Conflicts for " + pName + "\n");
              List<Dependency> confsForPackage = conflicts.get(pName);
              Iterator<Dependency> confs = confsForPackage.iterator();
              while (confs.hasNext()) {
                Dependency problem = confs.next();
                message.append("\t" + problem + "\n");
              }
            }

            JOptionPane.showConfirmDialog(PackageManager.this, message.toString(),
                "Weka Package Manager", JOptionPane.OK_OPTION);

            // bail out here
            //return null;
            m_unsuccessfulInstalls.add(packageToInstall);
            continue;
          }

          // Next check all dependencies against what is installed and
          // inform the user about which installed packages will be altered. Also
          // build the list of only those packages that need to be installed or
          // upgraded (excluding those that are already installed and are OK).
          List<PackageConstraint> needsUpgrade = new ArrayList<PackageConstraint>();
          List<Package> finalListToInstall = new ArrayList<Package>();

          Iterator<Dependency> depI = dependencies.iterator();
          boolean depsOk = true;
          while (depI.hasNext()) {
            Dependency toCheck = depI.next();
            if (toCheck.getTarget().getPackage().isInstalled()) {
              String toCheckName =
                toCheck.getTarget().getPackage().
                getPackageMetaDataElement("PackageName").toString();
              try {
                Package installedVersion = WekaPackageManager.getInstalledPackageInfo(toCheckName);
                if (!toCheck.getTarget().checkConstraint(installedVersion)) {
                  needsUpgrade.add(toCheck.getTarget());
                  Package mostRecent = toCheck.getTarget().getPackage();
                  if (toCheck.getTarget() instanceof
                      org.pentaho.packageManagement.VersionPackageConstraint) {
                    mostRecent =
                      WekaPackageManager.mostRecentVersionWithRespectToConstraint(toCheck.getTarget());
                  }
                  finalListToInstall.add(mostRecent);
                }
              } catch (Exception ex) {
                ex.printStackTrace();
                displayErrorDialog("An error has occurred while checking " +
                    "package dependencies", ex);
                // bail out here
                //return null;
                depsOk = false;
                break;
              }
            } else {
              try {
                Package mostRecent = toCheck.getTarget().getPackage();
                if (toCheck.getTarget() instanceof
                    org.pentaho.packageManagement.VersionPackageConstraint) {
                  mostRecent =
                    WekaPackageManager.mostRecentVersionWithRespectToConstraint(toCheck.getTarget());
                }
                finalListToInstall.add(mostRecent);
              } catch (Exception ex) {
                ex.printStackTrace();
                displayErrorDialog("An error has occurred while checking " +
                    "package dependencies", ex);
                // bail out here
                //return null;
                depsOk = false;
                break;
              }
            }
          }
         
          if (!depsOk) {
            // bail out on this package
            m_unsuccessfulInstalls.add(packageToInstall);
            continue;
          }

          if (needsUpgrade.size() > 0) {
            StringBuffer temp = new StringBuffer();
            for (PackageConstraint pc : needsUpgrade) {
              temp.append(pc + "\n");
            }
            int result = JOptionPane.showConfirmDialog(PackageManager.this,
                "The following packages will be upgraded in order to install:\n\n" + temp.toString(),
                "Weka Package Manager", JOptionPane.YES_NO_OPTION);

            if (result == JOptionPane.NO_OPTION) {
              // bail out here
              //return null;
              m_unsuccessfulInstalls.add(packageToInstall);
              continue;
            }

            // now take a look at the other installed packages and see if
            // any would have a problem when these ones are upgraded
            boolean conflictsAfterUpgrade = false;
            List<Package> installed = null;
            try {
              installed = WekaPackageManager.getInstalledPackages();
            } catch (Exception e) {
              e.printStackTrace();
              displayErrorDialog("Unable to determine what packages are installed!", e);
              //return null; // can't proceed
              m_unsuccessfulInstalls.add(packageToInstall);
              continue;
            }
            List<Package> toUpgrade = new ArrayList<Package>();
            for (PackageConstraint pc : needsUpgrade) {
              toUpgrade.add(pc.getPackage());
            }


            // add the actual package the user is wanting to install if it
            // is going to be an up/downgrade rather than a first install since
            // other installed packages may depend on the currently installed version
            // and thus could be affected after the up/downgrade
            toUpgrade.add(packageToInstall);

            StringBuffer tempM = new StringBuffer();
            depsOk = true;
            for (int i = 0; i < installed.size(); i++) {
              Package tempP = installed.get(i);
              String tempPName = tempP.getName();
              boolean checkIt = true;
              for (int j = 0; j < needsUpgrade.size(); j++) {
                if (tempPName.equals(needsUpgrade.get(j).getPackage().getName())) {
                  checkIt = false;
                  break;
                }
              }

              if (checkIt) {
                List<Dependency> problem = null;
                try {
                  problem = tempP.getIncompatibleDependencies(toUpgrade);
                } catch (Exception e) {
                  e.printStackTrace();
                  displayErrorDialog("An error has occurred while checking " +
                      "package dependencies", e);
                  // return null; // can't continue
                  depsOk = false;
                  break;
                }
                if (problem.size() > 0) {
                  conflictsAfterUpgrade = true;

                  tempM.append("Package " + tempP.getName() + " will have a compatibility" +
                  "problem with the following packages after upgrading them:\n");
                  Iterator<Dependency> dI = problem.iterator();
                  while (dI.hasNext()) {
                    tempM.append("\t" + dI.next().getTarget().getPackage() + "\n");
                  }
View Full Code Here

      // try and load any jar files and add to the classpath
      File[] contents = PACKAGES_DIR.listFiles();
      for (int i = 0 ; i < contents.length; i++) {
        if (contents[i].isDirectory()) {
          try {
            Package toLoad = getInstalledPackageInfo(contents[i].getName());
            boolean load;
            // Only perform the check against the current version of Weka if there exists
            // a Description.props file
            if (toLoad != null) {
View Full Code Here

   * @throws Exception if a version can't be found that satisfies the constraint
   * or an error occurs while communicating with the respository
   */
  public static Package mostRecentVersionWithRespectToConstraint(PackageConstraint toCheck)
    throws Exception {
    Package target = toCheck.getPackage();
    Package result = null;
   

    List<Object> availableVersions =
      PACKAGE_MANAGER.getRepositoryPackageVersions(target.getName());

    // version numbers will be in descending sorted order from the repository
    // we want the most recent version that meets the target constraint
    for (Object version : availableVersions) {
      Package candidate = PACKAGE_MANAGER.getRepositoryPackageInfo(target.getName(), version);
      if (toCheck.checkConstraint(candidate)) {
        /*System.out.println("**** Most recent version of " + target.getName()
            + "that meets the constraint " + toCheck.toString() + " is "
            + candidate.toString()); */
        result = candidate;
View Full Code Here

 
  public static void installPackageFromRepository(String packageName,
      String version, PrintStream... progress)
    throws Exception {   
    useCacheOrOnlineRepository();
    Package toLoad = getRepositoryPackageInfo(packageName);
   
    Object specialInstallMessage =
      toLoad.getPackageMetaDataElement("MessageToDisplayOnInstallation");
    if (specialInstallMessage != null &&
        specialInstallMessage.toString().length() > 0) {
      String siM = specialInstallMessage.toString();
      try {
        siM = Environment.getSystemWide().substitute(siM);
View Full Code Here

  }
 
  public static String installPackageFromArchive(String packageArchivePath,
      PrintStream... progress) throws Exception {
    useCacheOrOnlineRepository();   
    Package toInstall = PACKAGE_MANAGER.getPackageArchiveInfo(packageArchivePath);
   
    Object specialInstallMessage =
      toInstall.getPackageMetaDataElement("MessageToDisplayOnInstallation");
    if (specialInstallMessage != null &&
        specialInstallMessage.toString().length() > 0) {
      String siM = specialInstallMessage.toString();
      try {
        siM = Environment.getSystemWide().substitute(siM);
      } catch (Exception ex) {
        // quietly ignore
      }
      String message = "**** Special installation message ****\n"
        + siM
            + "\n**** Special installation message ****";
      for (PrintStream p : progress) {
        p.println(message);
      }
    }
   
    PACKAGE_MANAGER.installPackageFromArchive(packageArchivePath, progress);
   
    boolean loadIt = checkForMissingClasses(toInstall, progress);
    if (loadIt) {
      File packageRoot =
        new File(PACKAGE_MANAGER.getPackageHome() + File.separator
            + toInstall.getName());
      loadIt = checkForMissingFiles(toInstall, packageRoot, progress);
      if (loadIt) {
        loadPackageDirectory(packageRoot, false);
      }
    }
   
    return toInstall.getName();
  }
View Full Code Here

 
  public static String installPackageFromURL(URL packageURL, PrintStream... progress) throws Exception {
    useCacheOrOnlineRepository();   
    String packageName = PACKAGE_MANAGER.installPackageFromURL(packageURL, progress);
   
    Package installed = PACKAGE_MANAGER.getInstalledPackageInfo(packageName);
   
    Object specialInstallMessage =
      installed.getPackageMetaDataElement("MessageToDisplayOnInstallation");
    if (specialInstallMessage != null &&
        specialInstallMessage.toString().length() > 0) {
      String message = "**** Special installation message ****\n"
        + specialInstallMessage.toString()
            + "\n**** Special installation message ****";
      for (PrintStream p : progress) {
        p.println(message);
      }
    }
   
    boolean loadIt = checkForMissingClasses(installed, progress);
    if (loadIt) {
      File packageRoot =
        new File(PACKAGE_MANAGER.getPackageHome() + File.separator
            + installed.getName());
      loadIt = checkForMissingFiles(installed, packageRoot, progress);
      if (loadIt) {
        loadPackageDirectory(packageRoot, false);
      }
    }
View Full Code Here

  }
 
  private static void installPackageFromRepository(String packageName, String version,
      boolean force) throws Exception {
       
    Package toInstall = null;
    try {
      toInstall = getRepositoryPackageInfo(packageName, version);
    } catch (Exception ex) {
      System.err.println("[WekaPackageManager] Package " + packageName + " at version " + version
          + " doesn't seem to exist!");
      //System.exit(1);
      return;
    }
    // First check to see if this package is compatible with the base system
   
    if (!force) {
      boolean ok = toInstall.isCompatibleBaseSystem();
     
      if (!ok) {
        List<Dependency> baseSysDep = toInstall.getBaseSystemDependency();
        StringBuffer depList = new StringBuffer();
        for (Dependency bd : baseSysDep) {
          depList.append(bd.getTarget().toString() + " ");
        }
        System.err.println("Can't install package " + packageName
            + " because it requires " + depList.toString());
        return;
      }     
     
      // true if this package is already installed. In which case we need to check
      // if changing this package will impact other already installed packages
      boolean upOrDowngrading = false;
      if (toInstall.isInstalled()) {
        Package installedVersion = getInstalledPackageInfo(packageName);
        if (!toInstall.equals(installedVersion)) {

          System.out.println("Package " + packageName + "[" + installedVersion
              + "] is already installed. Replace with " + toInstall +" [y/n]?");
         
          String response = queryUser();
          if (response != null && (response.equalsIgnoreCase("n") ||
              response.equalsIgnoreCase("no"))) {
            return; // bail out here
          }
          upOrDowngrading = true;
        } else {
          System.out.println("Package " + packageName + "[" + installedVersion
              + "] is already installed. Install again [y/n]?");
          String response = queryUser();
          if (response != null && (response.equalsIgnoreCase("n") ||
              response.equalsIgnoreCase("no"))) {
            return; // bail out here
          }
        }
      }

      // Now get a full list of dependencies for this package and
      // check for any conflicts
      Map<String, List<Dependency>> conflicts = new HashMap<String, List<Dependency>>();
      List<Dependency> dependencies = getAllDependenciesForPackage(toInstall, conflicts);

      if (conflicts.size() > 0) {
        System.err.println("Package " + packageName + " requires the following packages:\n");
        Iterator<Dependency> depI = dependencies.iterator();
        while (depI.hasNext()) {
          Dependency d = depI.next();
          System.err.println("\t" + d);
        }
       
        System.err.println("\nThere are conflicting dependencies:\n");
        Set<String> pNames = conflicts.keySet();
        Iterator<String> pNameI = pNames.iterator();
        while (pNameI.hasNext()) {
          String pName = pNameI.next();
          System.err.println("Conflicts for " + pName);
          List<Dependency> confsForPackage = conflicts.get(pName);
          Iterator<Dependency> confs = confsForPackage.iterator();
          while (confs.hasNext()) {
            Dependency problem = confs.next();
            System.err.println("\t" + problem);
          }
        }
       
        System.err.println("Unable to continue with installation.");
        return; // bail out here.
      }
     
      // Next check all dependencies against what is installed and
      // inform the user about which installed packages will be altered. Also
      // build the list of only those packages that need to be installed or
      // upgraded (excluding those that are already installed and are OK).
      List<PackageConstraint> needsUpgrade = new ArrayList<PackageConstraint>();
      List<Package> finalListToInstall = new ArrayList<Package>();
     
      Iterator<Dependency> depI = dependencies.iterator();
      while (depI.hasNext()) {
        Dependency toCheck = depI.next();
        if (toCheck.getTarget().getPackage().isInstalled()) {
          String toCheckName =
            toCheck.getTarget().getPackage().
            getPackageMetaDataElement("PackageName").toString();
          Package installedVersion = PACKAGE_MANAGER.getInstalledPackageInfo(toCheckName);
          if (!toCheck.getTarget().checkConstraint(installedVersion)) {
            needsUpgrade.add(toCheck.getTarget());
            Package mostRecent = toCheck.getTarget().getPackage();
            if (toCheck.getTarget() instanceof
                org.pentaho.packageManagement.VersionPackageConstraint) {
              mostRecent =
                WekaPackageManager.mostRecentVersionWithRespectToConstraint(toCheck.getTarget());
            }
            finalListToInstall.add(mostRecent);
          }
        } else {
          Package mostRecent = toCheck.getTarget().getPackage();
          if (toCheck.getTarget() instanceof
              org.pentaho.packageManagement.VersionPackageConstraint) {
            mostRecent =
              WekaPackageManager.mostRecentVersionWithRespectToConstraint(toCheck.getTarget());
          }
          finalListToInstall.add(mostRecent);
        }
      }

      if (needsUpgrade.size() > 0) {
        System.out.println("The following packages will be upgraded in order to install "
            + packageName);
        Iterator<PackageConstraint> upI = needsUpgrade.iterator();
        while (upI.hasNext()) {
          PackageConstraint tempC = upI.next();
          System.out.println("\t" + tempC);
        }

        System.out.print("\nOK to continue [y/n]? > ");
        String response = queryUser();
        if (response != null && (response.equalsIgnoreCase("n") ||
            response.equalsIgnoreCase("no"))) {
          return; // bail out here
        }

        // now take a look at the other installed packages and see if
        // any would have a problem when these ones are upgraded
        boolean conflictsAfterUpgrade = false;
        List<Package> installed = getInstalledPackages();
        List<Package> toUpgrade = new ArrayList<Package>();
        upI = needsUpgrade.iterator();
        while (upI.hasNext()) {
          toUpgrade.add(upI.next().getPackage());
        }
       
        // add the actual package the user is wanting to install if it
        // is going to be an up/downgrade rather than a first install since
        // other installed packages may depend on the currently installed version
        // and thus could be affected after the up/downgrade
        toUpgrade.add(toInstall);
       
        for (int i = 0; i < installed.size(); i++) {
          Package tempP = installed.get(i);
          String tempPName = tempP.getName();
          boolean checkIt = true;
          for (int j = 0; j < needsUpgrade.size(); j++) {
            if (tempPName.equals(needsUpgrade.get(j).getPackage().getName())) {
              checkIt = false;
              break;
            }
          }

          if (checkIt) {
            List<Dependency> problem = tempP.getIncompatibleDependencies(toUpgrade);
            if (problem.size() > 0) {
              conflictsAfterUpgrade = true;

              System.err.println("Package " + tempP.getName() + " will have a compatibility" +
              "problem with the following packages after upgrading them:");
              Iterator<Dependency> dI = problem.iterator();
              while (dI.hasNext()) {
                System.err.println("\t" + dI.next().getTarget().getPackage());
              }
View Full Code Here

    result.append("Installed\tRepository\tPackage\n");
    result.append("=========\t==========\t=======\n");
   
    Iterator<Package> i = packageList.iterator();
    while (i.hasNext()) {
      Package p = i.next();
      String installedV = "-----    ";
      String repositoryV = "-----     ";
      if (p.isInstalled()) {
        Package installedP = getInstalledPackageInfo(p.getName());
        installedV = installedP.getPackageMetaDataElement("Version").toString() + "    ";
        try {
          Package repP = getRepositoryPackageInfo(p.getName());
          repositoryV = repP.getPackageMetaDataElement("Version").toString() + "     ";
        } catch (Exception ex) {
          // not at the repository
        }
      } else {
        repositoryV = p.getPackageMetaDataElement("Version").toString() + "     ";
View Full Code Here

TOP

Related Classes of org.pentaho.packageManagement.Package

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.