Examples of ProvisionException


Examples of com.google.inject.ProvisionException

public class Schema_52 extends SchemaVersion {
  @Inject
  Schema_52() {
    super(new Provider<SchemaVersion>() {
      public SchemaVersion get() {
        throw new ProvisionException("Cannot upgrade from 51");
      }
    });
  }
View Full Code Here

Examples of com.google.inject.ProvisionException

      try {
        final CurrentSchemaVersion sVer = getSchemaVersion(db);
        final int eVer = version.get().getVersionNbr();

        if (sVer == null) {
          throw new ProvisionException("Schema not yet initialized."
              + "  Run init to initialize the schema.");
        }
        if (sVer.versionNbr != eVer) {
          throw new ProvisionException("Unsupported schema version "
              + sVer.versionNbr + "; expected schema version " + eVer
              + ".  Run init to upgrade.");
        }
      } finally {
        db.close();
      }
    } catch (OrmException e) {
      throw new ProvisionException("Cannot read schema_version", e);
    }
  }
View Full Code Here

Examples of com.google.inject.ProvisionException

      @Provides
      IdentifiedUser provideCurrentUser(CurrentUser user) {
        if (user instanceof IdentifiedUser) {
          return (IdentifiedUser) user;
        }
        throw new ProvisionException(NotSignedInException.MESSAGE,
            new NotSignedInException());
      }
    };
  }
View Full Code Here

Examples of com.google.inject.ProvisionException

    if (StringUtils.isEmptyOrNull(url)) {
      return new NoContactStore();
    }

    if (!havePGP()) {
      throw new ProvisionException("BouncyCastle PGP not installed; "
          + " needed to encrypt contact information");
    }

    final URL storeUrl;
    try {
      storeUrl = new URL(url);
    } catch (MalformedURLException e) {
      throw new ProvisionException("Invalid contactstore.url: " + url, e);
    }

    final String storeAPPSEC = config.getString("contactstore", null, "appsec");
    final File pubkey = site.contact_information_pub;
    if (!pubkey.exists()) {
      throw new ProvisionException("PGP public key file \""
          + pubkey.getAbsolutePath() + "\" not found");
    }
    return new EncryptedContactStore(storeUrl, storeAPPSEC, pubkey, schema,
        connFactory);
  }
View Full Code Here

Examples of com.google.inject.ProvisionException

            @Override
            public File get() {
              if (!ready) {
                synchronized (dataDir) {
                  if (!dataDir.exists() && !dataDir.mkdirs()) {
                    throw new ProvisionException(String.format(
                        "Cannot create %s for plugin %s",
                        dataDir.getAbsolutePath(), name));
                  }
                  ready = true;
                }
View Full Code Here

Examples of com.google.inject.ProvisionException

    final String prngName = "SHA1PRNG";
    try {
      prng = SecureRandom.getInstance(prngName);
    } catch (NoSuchAlgorithmException e) {
      throw new ProvisionException("Cannot create " + prngName, e);
    }

    // Run a test encryption to verify the proper algorithms exist in
    // our JVM and we are able to invoke them. This helps to identify
    // a system configuration problem early at startup, rather than a
    // lot later during runtime.
    //
    try {
      encrypt("test", new Date(0), "test".getBytes("UTF-8"));
    } catch (NoSuchProviderException e) {
      throw new ProvisionException("PGP encryption not available", e);
    } catch (PGPException e) {
      throw new ProvisionException("PGP encryption not available", e);
    } catch (IOException e) {
      throw new ProvisionException("PGP encryption not available", e);
    }
  }
View Full Code Here

Examples of com.google.inject.ProvisionException

        return new PGPPublicKeyRingCollection(in);
      } finally {
        in.close();
      }
    } catch (IOException e) {
      throw new ProvisionException("Cannot read " + pub, e);
    } catch (PGPException e) {
      throw new ProvisionException("Cannot read " + pub, e);
    }
  }
View Full Code Here

Examples of org.eclipse.equinox.p2.core.ProvisionException

            }
          } catch (final Throwable _t) {
            if (_t instanceof IllegalStateException) {
              final IllegalStateException e = (IllegalStateException)_t;
            } else if (_t instanceof ProvisionException) {
              final ProvisionException e_1 = (ProvisionException)_t;
            } else if (_t instanceof OperationCanceledException) {
              final OperationCanceledException e_2 = (OperationCanceledException)_t;
            } else {
              throw Exceptions.sneakyThrow(_t);
            }
View Full Code Here

Examples of org.eclipse.equinox.p2.core.ProvisionException

    boolean _startsWith = _string.startsWith("bad");
    if (_startsWith) {
      String _string_1 = location.toString();
      String _plus = ("Bad location uri \'" + _string_1);
      String _plus_1 = (_plus + "\'");
      throw new ProvisionException(_plus_1);
    }
    return new MockMetadataRepository(location, this.resultProvider);
  }
View Full Code Here

Examples of org.eclipse.equinox.p2.core.ProvisionException

        public IMetadataRepository loadRepository(final URI location, final IProgressMonitor monitor) throws ProvisionException, OperationCanceledException {
          IMetadataRepository _xifexpression = null;
          String _string = location.toString();
          boolean _equals = "unknownHost".equals(_string);
          if (_equals) {
            throw new ProvisionException("Unknown Host");
          } else {
            _xifexpression = super.loadRepository(location, monitor);
          }
          return _xifexpression;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.