Package com.adito.boot

Examples of com.adito.boot.RepositoryStore


   */
  public ExtensionBundle installExtension(final String id, InputStream in) throws IOException, ExtensionException {
    streamToRepositoryStore(in, id);

    try {
      RepositoryStore repStore = RepositoryFactory.getRepository().getStore(ARCHIVE_STORE);
      ZipExtract.extractZipFile(getExtensionStoreDirectory(), repStore.getEntryInputStream(id + ".zip"));
      reload(id);
      ExtensionBundle newBundle = getExtensionBundle(id);
      installExtension(newBundle);
      fireBundleEvent(CoreEventConstants.INSTALL_EXTENSION, newBundle);
    } catch (IOException e) {
View Full Code Here


   * @throws Exception on any error
   */
  public void licenseCheck(final ExtensionBundle newBundle, HttpServletRequest request, final ActionForward installedForward)
          throws Exception {

    final RepositoryStore repStore = RepositoryFactory.getRepository().getStore(ARCHIVE_STORE);
    // If installing, there may be a license agreement to handle
    File licenseFile = newBundle.getLicenseFile();
    if (licenseFile != null && licenseFile.exists()) {
      LicenseAgreement licenseAgreement = getLicenseAgreement(newBundle, repStore, licenseFile, installedForward);
      CoreUtil.requestLicenseAgreement(request.getSession(), licenseAgreement);
View Full Code Here

      }
    }

    // Install Extension;
    streamToRepositoryStore(in, currentBundle.getId());
    RepositoryStore repStore = RepositoryFactory.getRepository().getStore(ARCHIVE_STORE);
    ZipExtract.extractZipFile(getExtensionStoreDirectory(), repStore.getEntryInputStream(currentBundle.getId() + ".zip"));

    if (containsPlugin) {
      currentBundle.setType(ExtensionBundle.TYPE_PENDING_UPDATE);
      fireBundleEvent(CoreEventConstants.UPDATE_EXTENSION, currentBundle);
      return currentBundle;
View Full Code Here

    VersionInfo.Version v2 = new VersionInfo.Version(current.getVersion().toString());
    return v1.compareTo(v2) > 0;
  }

  private static void streamToRepositoryStore(InputStream in, String bundleId) throws IOException {
    RepositoryStore repStore = RepositoryFactory.getRepository().getStore(ARCHIVE_STORE);
    OutputStream out = null;
    try {
      out = repStore.getEntryOutputStream(bundleId + ".zip");
      Util.copy(in, out);
    } finally {
      Util.closeStream(in);
      Util.closeStream(out);
    }
View Full Code Here

    }
  }

  private void initialiseRepository() {
    RepositoryStore store = RepositoryFactory.getRepository().getStore("archives");
    // Remove the existing extensions
    if (basedir.exists()) {
      Util.delTree(basedir);
    }

    // Now recreate all extensions from the repository
    basedir.mkdirs();
    String[] archives = store.listEntries();
    for (int i = 0; i < archives.length; i++) {
      if (log.isInfoEnabled()) {
        log.info("Extracting archive " + archives[i]);
      }
      try {
        ZipExtract.extractZipFile(basedir, store.getEntryInputStream(archives[i]));
        if (log.isInfoEnabled()) {
          log.info("Completed archive extraction for extension " + archives[i]);
        }
      } catch (IOException ex) {
        log.error("Error extracting archive for extension " + archives[i], ex);
View Full Code Here

            // Get the repository store
            Repository repository = RepositoryFactory.getRepository();
            if(upload.getExtraAttribute1() == null || upload.getExtraAttribute1().equals("")) {
                throw new Exception("No store name provided.");
            }
            RepositoryStore store = repository.getStore(upload.getExtraAttribute1());
           
            // Do the upload           
            InputStream in = uploadFile.getInputStream();
            try {
                OutputStream out = store.getEntryOutputStream(upload.getResourcePath()) ;
                try {
                    Util.copy(in, out);
                }
                finally {
                    Util.closeStream(out);
View Full Code Here

TOP

Related Classes of com.adito.boot.RepositoryStore

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.