@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(authzid.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(user.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(passwd.getBytes(StandardCharsets.UTF_8)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(ASCIIUtility.getBytes(authzid)); b64os.write(0); b64os.write(ASCIIUtility.getBytes(user)); b64os.write(0); b64os.write(ASCIIUtility.getBytes(passwd)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
return os; else if (encoding.equalsIgnoreCase("base64")) return new BASE64EncoderStream(os); else if (encoding.equalsIgnoreCase("quoted-printable")) return new QPEncoderStream(os);
return os; else if (encoding.equalsIgnoreCase("base64")) return new BASE64EncoderStream(os); else if (encoding.equalsIgnoreCase("quoted-printable")) return new QPEncoderStream(os);
return os; else if (encoding.equalsIgnoreCase("base64")) return new BASE64EncoderStream(os); else if (encoding.equalsIgnoreCase("quoted-printable")) return new QPEncoderStream(os);
return os; else if (encoding.equalsIgnoreCase("base64")) return new BASE64EncoderStream(os); else if (encoding.equalsIgnoreCase("quoted-printable")) return new QPEncoderStream(os);
throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); SecureRandom random; try {
throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); SecureRandom random; try {
OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE);
OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE);
OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); boolean first = true;
OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); boolean first = true;
@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(authzid.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(user.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(passwd.getBytes(StandardCharsets.UTF_8)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(authzid.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(user.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(passwd.getBytes(StandardCharsets.UTF_8)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(authzid.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(user.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(passwd.getBytes(StandardCharsets.UTF_8)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(authzid.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(user.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(passwd.getBytes(StandardCharsets.UTF_8)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(authzid.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(user.getBytes(StandardCharsets.UTF_8)); b64os.write(0); b64os.write(passwd.getBytes(StandardCharsets.UTF_8)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }
/** * This method dumps the version store as serialized, * GZIP compressed, Base64 encoded XML. * @return */ public String doGetVersionsAsCompressedXML() { if (this.versionStore == null) { return ""; } String xml = this.versionStore.toXML(); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(512); BASE64EncoderStream b64s = new BASE64EncoderStream(baos); GZIPOutputStream gos = new GZIPOutputStream(b64s); gos.write(xml.getBytes()); gos.finish(); gos.close(); return baos.toString(); } catch (IOException ex) { return ""; } }
/** * This method dumps the version store as serialized, * GZIP compressed, Base64 encoded XML. * @return */ public String doGetVersionsAsCompressedXML() { if (this.versionStore == null) { return ""; } String xml = this.versionStore.toXML(); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(512); BASE64EncoderStream b64s = new BASE64EncoderStream(baos); GZIPOutputStream gos = new GZIPOutputStream(b64s); gos.write(xml.getBytes()); gos.finish(); gos.close(); return baos.toString(); } catch (IOException ex) { return ""; } }
String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { // return "authzid<NUL>user<NUL>passwd" ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream b64os = new BASE64EncoderStream(bos, Integer.MAX_VALUE); if (authzid != null) b64os.write(ASCIIUtility.getBytes(authzid)); b64os.write(0); b64os.write(ASCIIUtility.getBytes(user)); b64os.write(0); b64os.write(ASCIIUtility.getBytes(passwd)); b64os.flush(); // complete the encoding return ASCIIUtility.toString(bos.toByteArray()); }