Re: [CODEC] Migrate issue from 1.3 to 1.4

2009-10-28 Thread Julius Davies
I bet you it's a similar bug to this:

http://code.google.com/p/oauth-signpost/issues/detail?id=18

3. The python-oauth library (the reference implementation for OAuth)
barfs because the signature is IYALjIZeGwFri8xtv4uIaDBO3Ow%3D%0D%0A
which decodes to 'IYALjIZeGwFri8xtv4uIaDBO3Ow=\r\n'.



Some code I wrote tonight highlights the problem:  the static
Base64.encodeBase64() vs. the instance (new Base64().encode()) methods
are behaving differently in this regard.  Since the unit-tests mostly
focus on the static methods, we missed this variation.


import org.apache.commons.codec.binary.*;

public class B64 {

  public static void main(String[] args) throws Exception {
Base64 b64 = new Base64();

String s1 =
aa;
String s2 = aa;
String s3 = a;

byte[] b1 = s1.getBytes(UTF-8);
byte[] b2 = s2.getBytes(UTF-8);
byte[] b3 = s3.getBytes(UTF-8);

byte[] result;
result = Base64.encodeBase64(b1);
System.out.println([ + new String(result, UTF-8) + ]);
result = b64.encode(b1);
System.out.println([ + new String(result, UTF-8) + ]);

result = Base64.encodeBase64(b2);
System.out.println([ + new String(result, UTF-8) + ]);
result = b64.encode(b2);
System.out.println([ + new String(result, UTF-8) + ]);

result = Base64.encodeBase64(b3);
System.out.println([ + new String(result, UTF-8) + ]);
result = b64.encode(b3);
System.out.println([ + new String(result, UTF-8) + ]);

  }
}


Here's my output:


$ java -cp commons-codec-1.3.jar:. B64
[YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==]
[YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==]
[YWFhYWFhYWFhYQ==]
[YWFhYWFhYWFhYQ==]
[YQ==]
[YQ==]

$ java -cp commons-codec-1.4.jar:. B64
[YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==]
[YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh
YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==
]
[YWFhYWFhYWFhYQ==]
[YWFhYWFhYWFhYQ==
]
[YQ==]
[YQ==
]




yours,

Julius



On Mon, Oct 26, 2009 at 1:10 PM, Gary Gregory
ggreg...@seagullsoftware.com wrote:

 Can you please be more specific? Can you supply a test case?

 Thank you,
 Gary

  -Original Message-
  From: Murat Yücel [mailto:kodeperke...@gmail.com]
  Sent: Monday, October 26, 2009 13:09
  To: user
  Subject: [CODEC] Migrate issue from 1.3 to 1.4
 
  Hi All
 
  We are currently using commons-codec in our project. We have used this
  version for about one year.
  This means that we have a lot of users in our database with encrypted
  password. We have used the Base64
  class to encode the passwords.
  The problem is that after upgrading to 1.4 none of the users can
  login, so we have made a rollback.
 
  Is this a known issue? I havent find anything on your website.
 
  Regards
 
  /Murat
 
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
  For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




--
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)
http://juliusdavies.ca/logging.html

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[BeanUtils] dependencies

2009-10-28 Thread Joonas Pulakka
Hello,

I'm wondering what external dependencies BeanUtils actually has. On the main
page http://commons.apache.org/beanutils/ it's mentioned
that commons-beanutils.jar has an optional dependency on Collections. What
does optional mean? Here
http://commons.apache.org/beanutils/dependencies.html it additionally says
Logging is a dependency. And then, here is stated that both Collections and
Logging packages are a _requirement_:
http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#overview.dependencies

Still, I've done some (very basic) successful experiments with BeanUtils
with neither Collections nor Logging on the Classpath. What's the deal?

Best Regards,
Joonas


Re: [BeanUtils] dependencies

2009-10-28 Thread Niall Pemberton
On Wed, Oct 28, 2009 at 10:44 AM, Joonas Pulakka joonas.pula...@iki.fi wrote:
 Hello,

 I'm wondering what external dependencies BeanUtils actually has. On the main
 page http://commons.apache.org/beanutils/ it's mentioned
 that commons-beanutils.jar has an optional dependency on Collections. What
 does optional mean? Here

You need Commons Collections if you use any of the following classes:
BeanMap
BeanPredicate
BeanPropertyValueChangeClosure
BeanPropertyValueEqualsPredicate
BeanToPropertyValueTransformer

 http://commons.apache.org/beanutils/dependencies.html it additionally says
 Logging is a dependency. And then, here is stated that both Collections and
 Logging packages are a _requirement_:
 http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#overview.dependencies

That page is out of date wrt to Commons Collections - patches welcome

 Still, I've done some (very basic) successful experiments with BeanUtils
 with neither Collections nor Logging on the Classpath. What's the deal?

I'm surprised that you didn't have any issues without commons logging
since some of the core features of beanutils use them.

Niall


 Best Regards,
 Joonas


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [BeanUtils] dependencies

2009-10-28 Thread Brent Worden
On Wed, Oct 28, 2009 at 6:03 AM, Niall Pemberton
niall.pember...@gmail.comwrote:

 On Wed, Oct 28, 2009 at 10:44 AM, Joonas Pulakka joonas.pula...@iki.fi
 wrote:
  Hello,
 
  I'm wondering what external dependencies BeanUtils actually has. On the
 main
  page http://commons.apache.org/beanutils/ it's mentioned
  that commons-beanutils.jar has an optional dependency on Collections.
 What
  does optional mean? Here

 You need Commons Collections if you use any of the following classes:
BeanMap
BeanPredicate
BeanPropertyValueChangeClosure
BeanPropertyValueEqualsPredicate
BeanToPropertyValueTransformer

  http://commons.apache.org/beanutils/dependencies.html it additionally
 says
  Logging is a dependency. And then, here is stated that both Collections
 and
  Logging packages are a _requirement_:
 
 http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#overview.dependencies

 That page is out of date wrt to Commons Collections - patches welcome


I took the liberty of checking in changes to the package.html.  Feel free to
critique.

Thanks,

Brent


Re: [BeanUtils] dependencies

2009-10-28 Thread Niall Pemberton
On Wed, Oct 28, 2009 at 3:45 PM, Brent Worden brent.wor...@gmail.com wrote:
 On Wed, Oct 28, 2009 at 6:03 AM, Niall Pemberton
 niall.pember...@gmail.comwrote:

 On Wed, Oct 28, 2009 at 10:44 AM, Joonas Pulakka joonas.pula...@iki.fi
 wrote:
  Hello,
 
  I'm wondering what external dependencies BeanUtils actually has. On the
 main
  page http://commons.apache.org/beanutils/ it's mentioned
  that commons-beanutils.jar has an optional dependency on Collections.
 What
  does optional mean? Here

 You need Commons Collections if you use any of the following classes:
    BeanMap
    BeanPredicate
    BeanPropertyValueChangeClosure
    BeanPropertyValueEqualsPredicate
    BeanToPropertyValueTransformer

  http://commons.apache.org/beanutils/dependencies.html it additionally
 says
  Logging is a dependency. And then, here is stated that both Collections
 and
  Logging packages are a _requirement_:
 
 http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#overview.dependencies

 That page is out of date wrt to Commons Collections - patches welcome


 I took the liberty of checking in changes to the package.html.  Feel free to
 critique.

Hey thanks! Looks good to me.

Niall

 Thanks,

 Brent


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



how FTPClient get file created time?

2009-10-28 Thread geek.shrek

Hi,
I'm using commons.net.ftp.FTPClient to list the file on ftp directory.

I can get last modification time for a file, but how can I get the file
created timestamp?


Thanks,
-- 
View this message in context: 
http://www.nabble.com/how-FTPClient-get-file-created-time--tp26102569p26102569.html
Sent from the Commons - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org