Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6C662200C74 for ; Sun, 14 May 2017 18:25:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6AFC8160BA9; Sun, 14 May 2017 16:25:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D98D160BA6 for ; Sun, 14 May 2017 18:25:29 +0200 (CEST) Received: (qmail 16117 invoked by uid 500); 14 May 2017 16:25:28 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 16107 invoked by uid 99); 14 May 2017 16:25:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 May 2017 16:25:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id F20A01A037A for ; Sun, 14 May 2017 16:25:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id J2IVI0u4bE6M for ; Sun, 14 May 2017 16:25:25 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6A9B55F36B for ; Sun, 14 May 2017 16:25:25 +0000 (UTC) Received: by mail-oi0-f42.google.com with SMTP id w10so108484287oif.0 for ; Sun, 14 May 2017 09:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=7K1rzDseipKWPbiy+9fyUDDX+1/fIWNGw8Gf+Af3mNk=; b=aYT3ZFWpryGpPKpAiAlKiGOgtr6IvccvrLIzCPHiaKelaOxbmi8SBEp1G+x9ugk8T9 crDdqBr+pL0oZjaRMFhoVlaSD6hg2Qqe9cl8b4fujRlv7eJVUiD8+Q6tyGVShQfkxt+V k1Vs9NTuAPJXUCKwsZrlchxjBHKI9NP7hm0qr0bc/K9MFbrxf+Uvy/ndSP2IUm9OPQ6x llYfG5MxrYZzCmlhPnjsLrIwGZ69hD2o7iLXLULrjoAv1+cI6v5IxnEqZSZv/dXgcdHA t21vfw/09CNbgXB3mBiBy64l2b7mcjTRUlleKE9hJhaz5trdDCXbeDnS1NAcQ6O781pc aX2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=7K1rzDseipKWPbiy+9fyUDDX+1/fIWNGw8Gf+Af3mNk=; b=oF+JkCEaOm+AGUhA6+og/rcrMhKucrz+UVTCnZQtsChuXs1bR4Dt93JkARZnb2oMtE VGFO14dXcNdOF1H6xDkcDi5pzS3oeJtvXyEIAxe7u4NxyajdzjTTHCVy/VPJWhaWdP2/ FdKl0tb6J3Unp4ZHEYWZK58kl0ARgm8nrjP8z1qRWfFRCvR6DN5Y9BoNbQPKyoP8TeB8 uQkZfd/ycsiao20XnmYfGo5S0muyYoRpZLzuxwR6YvZ3nChoc/I3A+yLdS72bOLPPs64 HET80y96AbS35h7tVfeTwXJWVmZHSlU1dNx+vJaCR/X0xULLK0lOlrw/KQbKiKvDV6k+ HZYA== X-Gm-Message-State: AODbwcBWV8X6Qii+YTxtVXFtqgu18RbLefOwblK0yXE/QeCQm8cU1AL7 ioL166nxq9TUaAlBKI+6GslGeFOFZmuz X-Received: by 10.202.56.137 with SMTP id f131mr974348oia.42.1494779118790; Sun, 14 May 2017 09:25:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.29.164 with HTTP; Sun, 14 May 2017 09:25:18 -0700 (PDT) In-Reply-To: References: From: RJ Date: Sun, 14 May 2017 12:25:18 -0400 Message-ID: Subject: Re: Binary to Base64 Conversion To: users@groovy.apache.org Content-Type: multipart/alternative; boundary="001a113cf13c64af60054f7e62b4" archived-at: Sun, 14 May 2017 16:25:30 -0000 --001a113cf13c64af60054f7e62b4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable the first problem is encoding. its coming in an encoded format that decodeBase64 cannot understand. Whats the equivalent of the following in groovy script? env.put("java.naming.ldap.attributes.binary","APPUID"); Thanks Guys On Sun, May 14, 2017 at 6:59 AM, Jeff Cave wrote: > I don't think this is not a Groovy problem, so much as a general > programming problem. > > The first thing I would point out is that in your example APPUID is not > base64encoded, there is nothing to base64decode. > > https://en.wikipedia.org/wiki/Base64 > > > I notice that in your example, APPUID is 16 characters. Is APPUID a UUID > (basically a 16-byte integer)? > > If so, > > - You may be looking to create an object of type `java.util.UUID`. > - You could also possibly use `java.math.BigInteger` > - Converting the binary array to a String in hex notation may also be > meaningful. > > It all depends on what your final intention is. > > Jeff Cave > > > On 14 May 2017 at 05:27, RJ wrote: > >> getBytes() disrupts the base64 format: >> >> > [B.decodeBase64() is applicable for argument types: () values: [] >> Possible solutions: encodeBase64(), encodeBase64(boolean)> >> org.codehaus.groovy.runtime.InvokerInvocationException: >> groovy.lang.MissingMethodException: No signature of method: >> [B.decodeBase64() is applicable for argument types: () values: [] >> Possible solutions: encodeBase64(), encodeBase64(boolean) >> >> Thanks >> >> >> On Sat, May 13, 2017 at 12:55 AM, Nelson, Erick < >> Erick.Nelson@hdsupply.com> wrote: >> >>> can appuid be read as bytes ( byte[] ) ?? >>> if So , then try then decodeBase64(byte[]) method maybe? >>> >>> Erick Nelson >>> Senior Developer >>> HD Supply, FM >>> Cell 858-740-6523 <(858)%20740-6523> >>> Home 760-930-0461 <(760)%20930-0461> >>> >>> *CONFIDENTIALITY NOTICE: This message is for intended addressee(s) only >>> and may contain information that is confidential, proprietary or exempt >>> from disclosure, and subject to terms at: **http://www.hdsupply.com/ema= il >>> **.* >>> >>> From: RJ >>> Reply-To: "users@groovy.apache.org" >>> Date: Friday, May 12, 2017 at 8:17 PM >>> To: "users@groovy.apache.org" >>> Subject: Re: Binary to Base64 Conversion >>> >>> Erick, >>> >>> Thanks for the response. >>> >>> The binary value from the webservice is >>> >>> APPUID=3D.=EF=BF=BD&Y=EF=BF=BD=EF=BF=BD=EF=BF=BDA=EF=BF=BDTzg=EF=BF=BD<= =EF=BF=BD^, >>> >>> The vendor tells me its binary on top of base64. If I try decodeBase64(= ) >>> on this, it throws: bad character in base64 value >>> I guess I need to convert it first from binary to base64 format, and >>> then decodeBase64(). >>> >>> >>> I don't find binary to base64 decoding in the link. >>> >>> On Fri, May 12, 2017 at 10:07 PM, Nelson, Erick < >>> Erick.Nelson@hdsupply.com> wrote: >>> >>>> Apache Commons codec >>>> >>>> https://commons.apache.org/proper/commons-codec/apidocs/org/ >>>> apache/commons/codec/binary/Base64.html >>>> >>>> >>>> Erick Nelson >>>> Senior Developer >>>> HD Supply, FM >>>> Cell 858-740-6523 <(858)%20740-6523> >>>> Home 760-930-0461 <(760)%20930-0461> >>>> >>>> *CONFIDENTIALITY NOTICE: This message is for intended addressee(s) onl= y >>>> and may contain information that is confidential, proprietary or exemp= t >>>> from disclosure, and subject to terms at: **http://www.hdsupply.com/em= ail >>>> **.* >>>> >>>> From: RJ >>>> Reply-To: "users@groovy.apache.org" >>>> Date: Friday, May 12, 2017 at 7:05 PM >>>> To: "users@groovy.apache.org" >>>> Subject: Binary to Base64 Conversion >>>> >>>> I have to deal with a binary value of base64 ID in a groovy script. So= , >>>> first I need to covert binary data to base64 format and then >>>> decodeBase64(). >>>> >>>> Any clues/thoughts ? Thanks!! >>>> >>> >>> >> > --001a113cf13c64af60054f7e62b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
the first problem is encoding. its coming in an encoded format that dec=
odeBase64 cannot understand.

Whats the equivalent of the following i= n groovy script?

env.put("java.naming.ldap.attributes.binary&qu= ot;,"APPUID");

=
Thanks Guys

On Sun, May 14, 2017 at 6:= 59 AM, Jeff Cave <jefferey.cave@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
I don't think this = is not a Groovy problem, so much as a general programming problem.

The first thing I would point out is that in your example = APPUID is not base64encoded, there is nothing to base64decode.
https:= //en.wikipedia.org/wiki/Base64

I = notice that in your example, APPUID is 16 characters. Is APPUID a UUID (bas= ically a 16-byte integer)?

If so,=C2=A0
    You may be looking to create an object of type `java.util.UUID`.=C2=A0
  • You could also possibly use `java.math.BigInteger`
  • Co= nverting the binary array to a String in hex notation may also be meaningfu= l.
It all depends on what your final intention is.<= /div>

Jef= f Cave


On 14= May 2017 at 05:27, RJ <ssoguroo@gmail.com> wrote:
getBytes() disrupts the bas= e64 format:

<groovy.lang.MissingMethodException: No signatur= e of method: [B.decodeBase64() is applicable for argument types: () values:= []
Possible solutions: encodeBase64(), encodeBase64(boolean)>
org.codehaus.groovy.runtime.= InvokerInvocationException: groovy.lang.MissingMethodExceptio= n: No signature of method: [B.decodeBase64() is applicable for argument typ= es: () values: []
Possible solutions: encodeBase64(), encodeBase64(boole= an)

Thanks


On Sat, May 13, 2017 at 12:55 AM, N= elson, Erick <Erick.Nelson@hdsupply.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
can appuid be read as bytes ( byte[] ) ??
if So , then try then decodeBase64(byte[]) method maybe?

Erick Nelson
Senior Developer
HD Supply, FM

CONFIDENTIALITY NOTICE: This message i= s for intended addressee(s) only and may contain information that is confid= ential, proprietary or exempt from disclosure, and subject to terms at:=C2= =A0http://www.hdsupply.com/email= .=


From: RJ <ssoguroo@gmail.com>
Reply-To: "users@groovy.apache.org"= <users@gro= ovy.apache.org>
Date: Friday, May 12, 2017 a= t 8:17 PM
To: "users@groovy.apache.org" <<= a href=3D"mailto:users@groovy.apache.org" target=3D"_blank">users@groovy.ap= ache.org>
Subject: Re: Binary to Base64 Conve= rsion

Erick,

Thanks for the response.

The binary value from the webservice is

APPUID=3D.=EF=BF=BD&Y=EF=BF=BD=EF=BF=BD=EF=BF=BDA=EF=BF=BDTzg=EF=BF=BD&= lt;=EF=BF=BD^,

The vendor tells me its binary on top of base64. If I try decodeBase64= () on this, it throws: bad character in base64 value
I guess I need to convert it first from binary to base64 format, and t= hen decodeBase64().


I don't find binary to base64 decoding in the link.

On Fri, May 12, 2017 at 10:07 PM, Nelson, Erick = <Erick.Ne= lson@hdsupply.com> wrote:
Apache Commons codec


Erick Nelson
Senior Developer
HD Supply, FM

CONFIDENTIALITY NOTICE: This message i= s for intended addressee(s) only and may contain information that is confid= ential, proprietary or exempt from disclosure, and subject to terms at:=C2= =A0http://www.hdsupply.com/email= .=


From: RJ <ssoguroo@gmail.com>
Reply-To: "users@groovy.apache.org"= <users@gro= ovy.apache.org>
Date: Friday, May 12, 2017 at 7:05 = PM
To: "users@groovy.apache.org" <<= a href=3D"mailto:users@groovy.apache.org" target=3D"_blank">users@groovy.ap= ache.org>
Subject: Binary to Base64 Conversio= n

I have to deal with a binary value of base64 ID in a groovy script. So= , first I need to covert binary data to base64 format and then decodeBase64= ().

Any clues/thoughts ? Thanks!!




--001a113cf13c64af60054f7e62b4--