Examples of Base64


Examples of org.apache.commons.codec.binary.Base64

    this.pluginLocations = bkConfig.getPluginLocations();
    this.pluginEnvps = bkConfig.getPluginEnvps();
    this.urlHash = bkConfig.getHash();
    this.pluginArgs = new HashMap<>();
    this.outputLogService = outputLogService;
    this.encoder = new Base64();
    this.nginxTemplate = utils.readFile(this.nginxDir + "/nginx.conf.template");
    if (nginxTemplate == null) {
      throw new RuntimeException("Cannot get nginx template");
    }
    this.ipythonTemplate = ("c = get_config()\n" +
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

  private ObjectMapper mapper;
  private String auth;
  private String urlBase;

  public NamespaceClient(String session) {
    this.encoder = new Base64();
    this.mapper = new ObjectMapper();
    this.session = session;
    String account = "beaker:" + System.getenv("beaker_core_password");
    this.auth = "Basic " + encoder.encodeBase64String(account.getBytes());
    this.urlBase = "http://127.0.0.1:" + System.getenv("beaker_core_port") +
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

            if (userName == null) userName = "";
            String password = (String)request.getAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD);
            if (password == null) password = "";
            if (type.equalsIgnoreCase(SSO_TYPE_URL_BASE64))
            {
                Base64 encoder = new Base64() ;
                userName = new String(encoder.encode(userName.getBytes()));
                password = new String(encoder.encode(password.getBytes()));
            }
           
            // GET and POST accept args differently
            if ( method instanceof PostMethod )
            {
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

  private int corePort = -1;
  private RServer rServer = null;
  private final Base64 encoder;

  public RShellRest() {
    this.encoder = new Base64();
  }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

        logEntry.setMessage(new String(body));
        return logEntry;
    }

    private void process(final LogEntry logEntry) throws TException, IOException {
        final Base64 base64 = new Base64();
        final byte[] decodedSpan = base64.decode(logEntry.getMessage());

        final ByteArrayInputStream buf = new ByteArrayInputStream(decodedSpan);
        final TProtocolFactory factory = new TBinaryProtocol.Factory();
        final TProtocol proto = factory.getProtocol(new TIOStreamTransport(buf));
        final Span span = new Span();
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

    final Path wd = new Path(new Path(
          System.getProperty("test.build.data", "/tmp")).makeQualified(fs),
        codec.getClass().getSimpleName());
    final Path file = new Path(wd, "test" + codec.getDefaultExtension());
    final byte[] b = new byte[REC_SIZE];
    final Base64 b64 = new Base64(0, null);
    DataOutputStream fout = null;
    Compressor cmp = CodecPool.getCompressor(codec);
    try {
      fout = new DataOutputStream(codec.createOutputStream(
            fs.create(file, true), cmp));
      final DataOutputBuffer dob = new DataOutputBuffer(REC_SIZE * 4 / 3 + 4);
      int seq = 0;
      while (infLen > 0) {
        rand.nextBytes(b);
        final byte[] b64enc = b64.encode(b); // ensures rand printable, no LF
        dob.reset();
        dob.writeInt(seq);
        System.arraycopy(dob.getData(), 0, b64enc, 0, dob.getLength());
        fout.write(b64enc);
        fout.write('\n');
View Full Code Here

Examples of org.apache.manifoldcf.core.common.Base64

            pw.print("\"_content_type\" : "+jsonStringEscape(contentType)+",");
          String fileName = document.getFileName();
          if (fileName != null)
            pw.print("\"_name\" : "+jsonStringEscape(fileName)+",");
          pw.print(" \"content\" : \"");
          Base64 base64 = new Base64();
          base64.encodeStream(inputStream, pw);
          pw.print("\"}");
        }
       
        pw.print("}");
      } catch (ManifoldCFException e)
View Full Code Here

Examples of org.apache.mina.util.Base64

     * @throws NoSuchAlgorithmException
     * @throws InvalidKeySpecException
     */
    public static final Map<PublicKey, AuthorizedKey> parseAuthorizedKeys(InputStream is) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException {
        try {
            Base64 decoder = new Base64();

            KeyFactory rsaKeyGen = KeyFactory.getInstance("RSA");
            KeyFactory dsaKeyGen = KeyFactory.getInstance("DSA");

            LineNumberReader reader = new LineNumberReader(new InputStreamReader(is, "UTF-8"));
           
            Map<PublicKey, AuthorizedKey> ret = new TreeMap<PublicKey, AuthorizedKey>(new PublicKeyComparator());

            String line;

            while ((line = reader.readLine()) != null) {
              if (line.startsWith("#")) {
                continue; //skip # lines might be comment
              }
                String[] tokens = line.split("[ \\t]+", 3);
                if (tokens.length != 3) {
                    throw new IOException("Authorized keys file line " + reader.getLineNumber() + " does not contain 3 tokens.");
                }
                byte[] rawKey = decoder.decode(tokens[1].getBytes("UTF-8"));
                if (getInt(rawKey, 0) != 7 || !new String(rawKey, 4, 7, "UTF-8").equals(tokens[0])) {
                    throw new IOException("Authorized keys file line " + reader.getLineNumber() + " contains a key with a format that does not match the first token.");
                }
                PublicKey pk;
                if (tokens[0].equals("ssh-dss")) {
View Full Code Here

Examples of org.apache.wicket.util.crypt.Base64

      return new ICrypt()
      {

        public String decryptUrlSafe(String text)
        {
          return new String(new Base64(true).decode(text));
        }

        public String encryptUrlSafe(String plainText)
        {
          return new String(new Base64(true).encode(plainText.getBytes()));
        }

        public void setKey(String key)
        {
        }
View Full Code Here

Examples of org.bouncycastle.util.encoders.Base64

        // Si el servidor pide autenticaci�n, mandar solicitud con credenciales.
        // No mandar en con HTTP, siempre con HTTPS!!
        if (authorization)
        {
          String userCredentials = TxtES.userCredentials;
          new Base64();
          String basicAuth = "Basic " + new String(Base64.encode(userCredentials.getBytes()));
          connection.setRequestProperty ("Authorization", basicAuth);
        }
        // M�todo de conexi�n con POST, ya que datos se mandan dentro del cuerpo del mensaje.
        connection.setRequestMethod("POST");
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.