svn commit: r400092 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: ClassUtils.java LocaleUtils.java builder/ReflectionToStringBuilder.java text/StrBuilder.java

2006-05-05 Thread fredrik
Author: fredrik
Date: Fri May  5 08:23:31 2006
New Revision: 400092

URL: http://svn.apache.org/viewcvs?rev=400092view=rev
Log:
Resolved a few checkstyle issues.

Modified:

jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java

jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java

jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java

jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java

Modified: 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java?rev=400092r1=400091r2=400092view=diff
==
--- 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java
 (original)
+++ 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ClassUtils.java
 Fri May  5 08:23:31 2006
@@ -604,6 +604,14 @@
  *  Method method = ClassUtils.getPublicMethod(set.getClass(), isEmpty,  
new Class[0]);
  *  Object result = method.invoke(set, new Object[]);/pre/code
  * /p
+ *
+ * @param cls the class to check
+ * @param methodName the name of the method
+ * @param parameterTypes the list of parameters
+ * @return the method
+ * @throws SecurityException If a a security violation occured
+ * @throws NoSuchMethodException If the method is not found in the given 
class
+ *  or if the metothod doen't conform with the requirements
  */
 public static Method getPublicMethod(Class cls, String methodName, Class 
parameterTypes[]) 
 throws SecurityException, NoSuchMethodException 

Modified: 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java?rev=400092r1=400091r2=400092view=diff
==
--- 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java
 (original)
+++ 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java
 Fri May  5 08:23:31 2006
@@ -215,6 +215,7 @@
 /**
  * pChecks if the locale specified is in the list of available 
locales./p
  *
+ * @param locale the Locale object to check if it is available
  * @return true if the locale is a known locale
  */
 public static boolean isAvailableLocale(Locale locale) {

Modified: 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java?rev=400092r1=400091r2=400092view=diff
==
--- 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
 (original)
+++ 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
 Fri May  5 08:23:31 2006
@@ -23,10 +23,7 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Set;
-
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.ClassUtils;
 

Modified: 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java?rev=400092r1=400091r2=400092view=diff
==
--- 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
 (original)
+++ 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
 Fri May  5 08:23:31 2006
@@ -1241,7 +1241,6 @@
  * @param removeLen  the length to remove (endIndex - startIndex), must be 
valid
  * @param insertStr  the string to replace with, null means delete range
  * @param insertLen  the length of the insert string, must be valid
- * @param len  the length, must be valid
  * @throws IndexOutOfBoundsException if any index is invalid
  */
 private void replaceImpl(int startIndex, int endIndex, int removeLen, 
String insertStr, int insertLen) {



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r399834 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java

2006-05-04 Thread fredrik
Author: fredrik
Date: Thu May  4 12:29:00 2006
New Revision: 399834

URL: http://svn.apache.org/viewcvs?rev=399834view=rev
Log:
Renamed a parameter in the javadoc to reflect the name of the input parameter 
in the method signature.

Modified:

jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java

Modified: 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java?rev=399834r1=399833r2=399834view=diff
==
--- 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java
 (original)
+++ 
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java
 Thu May  4 12:29:00 2006
@@ -83,7 +83,7 @@
 /**
  * Utility method to parse and then reformat a String. 
  * 
- * @param source String to reformat
+ * @param input String to reformat
  * @return A reformatted String
  * @throws ParseException thrown by parseObject(String) call
  */



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] ExceptionUtils methods

2005-11-15 Thread Fredrik Westermarck

Stephen Colebourne wrote:

Could I propose some new methods for ExceptionUtils:

- ExceptionUtils.getLogMessageNoStackTrace(ex)

- ExceptionUtils.getLogMessageShortStackTrace(ex, lines)


I'm +1 on adding the methods.

Regarding the names of the methods I agree with Gary in his last post, 
where he suggests ExceptionUtils.toMessage(ex) and 
ExceptionUtils.toMessage(ex, stackFrameCount).


--
Regards,
Fredrik Westermarck


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Obtaining the source code

2005-11-04 Thread Fredrik Persson
Hi there!
I'm planning to try to use Jakarta Feedparser in a new project, but I
can't get the source code. The svn repository is not accesible.

Can anyone help me and explain how to get the source or even a
jar-library.

// Fredrik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] VOTE 2.1 release based on RC8

2005-06-07 Thread Fredrik Westermarck

Steven Caswell wrote:
Now that RC8 (http://www.apache.org/~stevencaswell/commons-lang-2.1) has 
been up for a few days with no issues, I propose it becomes the 2.1 release.


[X] +1
[ ] -1

Regards,
Fredrik Westermarck

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] checkstyle report

2005-05-25 Thread Fredrik Westermarck

Steven Caswell wrote:
I propose that for the upcoming lang 2.1 release we leave the errors unfixed 
and leave the checkstyle report as is.


1. Leave them unfixed because the errors are all documentation-related, and 
while it is important to fix them, I don't believe the problems are 
detrimental to the product. It has taken long enough to get the release out 
(and I take some of the blame for the slowness) and I don't believe it is 
worth delaying longer to make what I consider marginally useful fixes. 
Unless someone gets to them before the final RC.


I would like to have a go at them but since I don't feel too confident 
about my svn skills it's probably better to learn svn before I start 
committing again. :-)


off-topic
While on the subject of svn; is there a repository (at apache) where one 
can test svn without causing a mess? :-P

/off-topic

2. Leave the checkstyle report as is because the problems should be fixed, 
and I'm worried that if we hide them for this release then they'll be 
forgotten. I'd rather take the time after the release to either fix them or 
hide them after appropriate discussion, which I believe should also not hold 
up the release.


Thoughts?


I agree with your proposal to wait until after a release to decide on 
how to resolve the issues. After all the number of checkstyle issues 
have decreased in 2.1-RC6, when comparing it to the 2.0 release.


Regards,
Fredrik Westermarck


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] VOTE 2.1 release

2005-04-12 Thread Fredrik Westermarck
Henri Yandell wrote:
Proposing a vote to go ahead and release Commons Lang 2.1.
[X] +1
[ ] -1
/Fredrik Westermarck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [lang] New StringUtils method - defaultIfEmpty

2005-04-09 Thread Fredrik Westermarck
Stephen Colebourne wrote:
Currently we have two default methods, both of which default when the 
string parameter is null. At my job we just had need of a default if 
empty method:

public String defaultIfEmpty(String str, String defaultString) {
 if (isEmpty(str)) {
  return defaultString;
 } else {
  return str;
 }
}
Does this sound OK to add?
Since what you describe is a rather common use case I'm +1.
/Fredrik Westermarck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [VOTE] Matthew Inger as Commons Committer Re: [Lang] Commit Karma

2004-12-01 Thread Fredrik Westermarck
Henri Yandell wrote:
Quick vote so that Matthew can work on the code he contributed to
Lang. He's a Jakarta committer already, so will just be a case of
adding karma.
[ ] +1 - Fix it
[ ]  -1 - Send a patch
+1
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [lang] CharacterEncoding

2004-10-01 Thread Fredrik Westermarck
Stephen Colebourne wrote:
We should move to decide on the inclusion or not of this class.
My vote is +1
However I would prefer the name CharEncoding (avoids clash with sun class
and fits better with other lang classes)
+1 on inclusion of the class and the name of the class.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang WordUtils.java

2004-09-02 Thread fredrik
fredrik 2004/09/02 12:04:56

  Modified:lang/src/java/org/apache/commons/lang WordUtils.java
  Log:
  Fixed a couple of typos in javadoc.
  
  Revision  ChangesPath
  1.14  +8 -7  
jakarta-commons/lang/src/java/org/apache/commons/lang/WordUtils.java
  
  Index: WordUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/WordUtils.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WordUtils.java4 Jun 2004 03:58:27 -   1.13
  +++ WordUtils.java2 Sep 2004 19:04:56 -   1.14
  @@ -317,9 +317,9 @@
* upper case./p
*
* pre
  - * WordUtils.capitalize(null)= null
  - * WordUtils.capitalize()  = 
  - * WordUtils.capitalize(i am FINE) = I Am Fine
  + * WordUtils.capitalizeFully(null)= null
  + * WordUtils.capitalizeFully()  = 
  + * WordUtils.capitalizeFully(i am FINE) = I Am Fine
* /pre
* 
* @param str  the String to capitalize, may be null
  @@ -342,9 +342,10 @@
* upper case./p
*
* pre
  - * WordUtils.capitalize(null)= null
  - * WordUtils.capitalize()  = 
  - * WordUtils.capitalize(i am FINE) = I Am Fine
  + * WordUtils.capitalizeFully(null, null) = null
  + * WordUtils.capitalizeFully(, null)   = 
  + * WordUtils.capitalizeFully(i am FINE, new char[] {' '})  = I Am Fine
  + * WordUtils.capitalizeFully(i+am-FINE, new char[] {'-', '+'}) = I+Am-Fine
* /pre
* 
* @param str  the String to capitalize, may be null
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang StringUtils.java

2004-09-02 Thread fredrik
fredrik 2004/09/02 12:16:19

  Modified:lang/src/java/org/apache/commons/lang StringUtils.java
  Log:
  Fixed a typo in javadoc.
  
  Revision  ChangesPath
  1.135 +2 -2  
jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.134
  retrieving revision 1.135
  diff -u -r1.134 -r1.135
  --- StringUtils.java  22 Aug 2004 03:40:27 -  1.134
  +++ StringUtils.java  2 Sep 2004 19:16:18 -   1.135
  @@ -4424,7 +4424,7 @@
   /**
* pReverses a String as per [EMAIL PROTECTED] StringBuffer#reverse()}./p
*
  - * pA codenull/code String returns codenull/code./p
  + * pA codenull/code String returns codenull/code./p
*
* pre
* StringUtils.reverse(null)  = null
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] Designs and Futures

2004-06-02 Thread Fredrik Westermarck
Henri Yandell wrote:
As a basic rule, I think it's pretty fair to state that package hierarchy
should be obeyed as far as dependencies goes. This means that a package's
classes may not depend on a sibling package, or a child package, but it may
depend on a super-package or classes within the same package.
Never thought about package dependencies that way, but it seems 
reasonable too me - atleast when dealing with utility classes like the 
ones in [lang].

Looking at the Validate example, I think it's pretty small fry. It's in
the same package as String/ArrayUtils, so logically should be able to
depend on them, and it's merely the isEmpty methods.
I'm +1 to maintaining the isEmpty calls, but do agree with Stephen's
general principle.
This is really a non-issue but I'll take the opportunity to present my 
opinion anyway. ;-)

Not reusing your own utilities because you want to be able to do 
cut-and-paste coding does seem a bit far fetched too me. It's my opinion 
that [lang] should be considered as a whole and complete product. The 
main goal is not to distribute a bunch of source files that people can 
cut-and-paste from, but a whole and functional product. If someone out 
there downloads the source code and on its own cut-and-pastes a method 
they have to adopt it to their environment and their use case as well as 
maintaining it. We cannot (and should not in my opinion) predict what 
metohods people want to be able to cut-and-paste.

If we decide that we do want to support cut-and-paste coding it ought to 
be stated as a design goal in the docs - it's a bit hard to guess this 
as a newcomer or an outsider. :-)

While we're talking about Validate anyway - how about renaming it to 
ValidateUtils like all other utility classes?

Regards,
Fredrik Westermarck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang StringUtils.java

2004-05-24 Thread fredrik
fredrik 2004/05/24 13:15:44

  Modified:lang/src/java/org/apache/commons/lang StringUtils.java
  Log:
  PR: http://issues.apache.org/bugzilla/show_bug.cgi?id=28468
  Fixed error in javadoc.
  Submitted by: Christian d'Heureuse
  
  Revision  ChangesPath
  1.130 +3 -3  
jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.129
  retrieving revision 1.130
  diff -u -r1.129 -r1.130
  --- StringUtils.java  10 Mar 2004 23:54:48 -  1.129
  +++ StringUtils.java  24 May 2004 20:15:44 -  1.130
  @@ -4032,8 +4032,8 @@
   }
   
   /**
  - * pReturns either the passed in String,
  - * or if the String is codenull/code, an empty String ()./p
  + * pReturns either the passed in String, or if the String is
  + * codenull/code, the value of codedefaultStr/code./p
*
* pre
* StringUtils.defaultString(null, null)  = null
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] Markup stuff on lang???

2004-05-10 Thread Fredrik Westermarck
Stephen Colebourne wrote:

There was some effort towards creating a 2.1 a couple of months ago, but it
came to nothing. We should have another go really ;-)
I agree.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Problems using SSL from inside JBoss (jsse problem?)

2004-04-27 Thread Fredrik Bonde
Hi Oleg, thanks for your reply,
Yes, I got a mail out on the jboss forums as well, but haven't had any luck
there yet. I have tried just using HttpsURLConnection to no avail. I did go
through the SSL troubleshooting guide on the httpclient site, but could
unfortunately not find a solution. I suspect the error to be somewhere in
how jboss handles jsse somehow, somewhere, so my current plan is to dive in
there.
Again thanks for your time.
/Fredrik

 

-Original Message-
From: Kalnichevski, Oleg [mailto:[EMAIL PROTECTED] 
Sent: 26 April 2004 17:16
To: Commons HttpClient Project
Cc: [EMAIL PROTECTED]
Subject: RE: Problems using SSL from inside JBoss (jsse problem?)



Fredrik,

This problem is clearly not HttpClient related, hence you have not been
getting a lot of responses. HttpClient simply expects JSSE to be there and
be properly configured in order for the HTTPS support to be functional.
Please take a look at the HttpClient SSL guide paying special attention to
the troubleshooting section

http://jakarta.apache.org/commons/httpclient/sslguide.html

Hope this helps a little

Oleg


-Original Message-
From: Fredrik Bonde [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 21, 2004 13:18
To: '[EMAIL PROTECTED]'
Subject: Problems using SSL from inside JBoss (jsse problem?)


Hi all, I got a questing regarding using HttpClient from an MDB inside
Jboss. Normal http connections work fine, but whenever I try to connect to a
host using https I get a SocketException, claiming SSL is not available:

12:13:39,338 INFO  [STDOUT] 2004-04-21 12:13:39,322 ERROR
(HttpClientWrapper.java:120) Unable to connect to 'https://mail.yahoo.com'
java.net.SocketException: SSL implementation not available
at
javax.net.ssl.DefaultSSLSocketFactory.createSocket([DashoPro-V1.2-120198])
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:112)
at
org.apache.commons.httpclient.HttpConnection$1.doit(HttpConnection.java:691)
at
org.apache.commons.httpclient.HttpConnection$SocketTask.run(HttpConnection.j
ava:1299)
at java.lang.Thread.run(Thread.java:534)
12:13:39,322 ERROR [HttpClientWrapper] Unable to connect to
'https://mail.yahoo.com'
java.net.SocketException: SSL implementation not available
at
javax.net.ssl.DefaultSSLSocketFactory.createSocket([DashoPro-V1.2-120198])
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:112)
at
org.apache.commons.httpclient.HttpConnection$1.doit(HttpConnection.java:691)
at
org.apache.commons.httpclient.HttpConnection$SocketTask.run(HttpConnection.j
ava:1299)
at java.lang.Thread.run(Thread.java:534)

The code works fine outside Jboss so I suppose there something I need to do
in order to enable jsse for Jboss. The problem is that I do not have a clue
*how* to set it up! If anyone could help me it would be greatly appreciated.



I'm using Java 1.4_02, HttpClient 2.0-final and Jboss 3.2.3. I have also
tried to set the system property java.protocol.handler.pkgs to
com.sun.net.ssl.internal.www.protocol using: String sRes =
System.setProperty(java.protocol.handler.pkgs,com.sun.net.ssl.internal.ww
w.protocol);

also I try to add a provider with:
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); 


code looks like this:
  HttpClient httpClient = new HttpClient();
httpClient.setConnectionTimeout(connectTimeout);
httpClient.setTimeout(readTimeout);

  HttpMethod method = null;

//debug
System.setProperty(org.apache.commons.logging.Log,
org.apache.commons.logging.impl.SimpleLog);


System.setProperty(org.apache.commons.logging.simplelog.showdatetime,
true);


System.setProperty(org.apache.commons.logging.simplelog.log.httpclient.wire
, debug);


System.setProperty(org.apache.commons.logging.simplelog.log.org.apache.comm
ons.httpclient, debug);


String sRes =
System.setProperty(java.protocol.handler.pkgs,com.sun.net.ssl.internal.ww
w.protocol);
int ret = Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider()); 



method = new GetMethod(url.toExternalForm());
method.setFollowRedirects(true);

//execute the method
try{
httpClient.executeMethod(method);  // here exception is thrown
String res =  method.getResponseBodyAsString();
method.releaseConnection();
return res;

} catch (HttpException e) {
_log.error(Http error connecting to ' + url + ', e);
throw new HttpClientException(e.getMessage());

} catch (IOException e){
_log.error(Unable to connect to ' + url + ', e);
throw new HttpClientException(e.getMessage());
}

Kind regards,

Fredrik Bonde ~ Java Developer




-
To unsubscribe, e-mail:
[EMAIL

Problems using SSL from inside JBoss (jsse problem?)

2004-04-21 Thread Fredrik Bonde
Hi all, I got a questing regarding using HttpClient from an MDB inside
Jboss.
Normal http connections work fine, but whenever I try to connect to a host
using https I get a SocketException, claiming SSL is not available:

12:13:39,338 INFO  [STDOUT] 2004-04-21 12:13:39,322 ERROR
(HttpClientWrapper.java:120) Unable to connect to 'https://mail.yahoo.com'
java.net.SocketException: SSL implementation not available
at
javax.net.ssl.DefaultSSLSocketFactory.createSocket([DashoPro-V1.2-120198])
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:112)
at
org.apache.commons.httpclient.HttpConnection$1.doit(HttpConnection.java:691)
at
org.apache.commons.httpclient.HttpConnection$SocketTask.run(HttpConnection.j
ava:1299)
at java.lang.Thread.run(Thread.java:534)
12:13:39,322 ERROR [HttpClientWrapper] Unable to connect to
'https://mail.yahoo.com'
java.net.SocketException: SSL implementation not available
at
javax.net.ssl.DefaultSSLSocketFactory.createSocket([DashoPro-V1.2-120198])
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:112)
at
org.apache.commons.httpclient.HttpConnection$1.doit(HttpConnection.java:691)
at
org.apache.commons.httpclient.HttpConnection$SocketTask.run(HttpConnection.j
ava:1299)
at java.lang.Thread.run(Thread.java:534)

The code works fine outside Jboss so I suppose there something I need to do
in order to enable jsse for Jboss. The problem is that I do not have a clue
*how* to set it up! If anyone could help me it would be greatly appreciated.



I'm using Java 1.4_02, HttpClient 2.0-final and Jboss 3.2.3. I have also
tried to set the system property java.protocol.handler.pkgs to
com.sun.net.ssl.internal.www.protocol using:
String sRes =
System.setProperty(java.protocol.handler.pkgs,com.sun.net.ssl.internal.ww
w.protocol);

also I try to add a provider with:
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());  

code looks like this:
  HttpClient httpClient = new HttpClient();
httpClient.setConnectionTimeout(connectTimeout);
httpClient.setTimeout(readTimeout);

  HttpMethod method = null;

//debug
System.setProperty(org.apache.commons.logging.Log,
org.apache.commons.logging.impl.SimpleLog);
 
System.setProperty(org.apache.commons.logging.simplelog.showdatetime,
true);
 
System.setProperty(org.apache.commons.logging.simplelog.log.httpclient.wire
, debug);
 
System.setProperty(org.apache.commons.logging.simplelog.log.org.apache.comm
ons.httpclient, debug);


String sRes =
System.setProperty(java.protocol.handler.pkgs,com.sun.net.ssl.internal.ww
w.protocol);
int ret = Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());  


method = new GetMethod(url.toExternalForm());
method.setFollowRedirects(true);

//execute the method
try{
httpClient.executeMethod(method);  // here exception is thrown
String res =  method.getResponseBodyAsString();
method.releaseConnection();
return res;

} catch (HttpException e) {
_log.error(Http error connecting to ' + url + ', e);
throw new HttpClientException(e.getMessage());

} catch (IOException e){
_log.error(Unable to connect to ' + url + ', e);
throw new HttpClientException(e.getMessage());
}

Kind regards,

Fredrik Bonde ~ Java Developer

 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang StringUtilsIsTest.java

2004-02-24 Thread fredrik
fredrik 2004/02/24 14:31:43

  Modified:lang/src/java/org/apache/commons/lang StringUtils.java
   lang/src/test/org/apache/commons/lang StringUtilsIsTest.java
  Log:
  Added isAsciiPrintable() http://issues.apache.org/bugzilla/show_bug.cgi?id=22489.
  
  Revision  ChangesPath
  1.128 +41 -2 
jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- StringUtils.java  19 Feb 2004 21:31:19 -  1.127
  +++ StringUtils.java  24 Feb 2004 22:31:42 -  1.128
  @@ -54,7 +54,7 @@
*  - changes the case of a String/li
*  libCountMatches/b
*  - counts the number of occurrences of one String in another/li
  - *  libIsAlpha/IsNumeric/IsWhitespace/b
  + *  libIsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable/b
*  - checks the characters in a String/li
*  libDefaultString/b
*  - protects against a null input String/li
  @@ -109,6 +109,7 @@
* @author Gary Gregory
* @author Phil Steitz
* @author Al Chou
  + * @author Michael Davey
* @since 1.0
* @version $Id$
*/
  @@ -3862,6 +3863,44 @@
   return true;
   }
   
  +/**
  + * pChecks if the string contains only ASCII printable characters./p
  + * 
  + * pcodenull/code will return codefalse/code.
  + * An empty String () will return codetrue/code./p
  + * 
  + * pre
  + * StringUtils.isAsciiPrintable(null) = false
  + * StringUtils.isAsciiPrintable()   = true
  + * StringUtils.isAsciiPrintable( )  = true
  + * StringUtils.isAsciiPrintable(Ceki)   = true
  + * StringUtils.isAsciiPrintable(ab2c)   = true
  + * StringUtils.isAsciiPrintable(!ab-c~) = true
  + * StringUtils.isAsciiPrintable(\u0020) = true
  + * StringUtils.isAsciiPrintable(\u0021) = true
  + * StringUtils.isAsciiPrintable(\u007e) = true
  + * StringUtils.isAsciiPrintable(\u007f) = false
  + * StringUtils.isAsciiPrintable(Ceki G\u00fclc\u00fc) = false
  + * /pre
  + *
  + * @param str the string to check, may be null
  + * @return codetrue/code if every character is in the range
  + *  32 thru 126
  + * @since 2.1
  + */
  +public static boolean isAsciiPrintable(String str) {
  +if (str == null) {
  +return false;
  +}
  +int sz = str.length();
  +for (int i = 0; i  sz; i++) {
  +if (CharUtils.isAsciiPrintable(str.charAt(i)) == false) {
  +return false;
  +}
  +}
  +return true;
  +}
  +  
   /**
* pChecks if the String contains only unicode digits.
* A decimal point is not a unicode digit and returns false./p
  
  
  
  1.9   +27 -1 
jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsIsTest.java
  
  Index: StringUtilsIsTest.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsIsTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StringUtilsIsTest.java18 Feb 2004 23:06:19 -  1.8
  +++ StringUtilsIsTest.java24 Feb 2004 22:31:43 -  1.9
  @@ -24,6 +24,7 @@
* Unit tests [EMAIL PROTECTED] org.apache.commons.lang.StringUtils} - Substring 
methods
*
* @author a href=mailto:[EMAIL PROTECTED]Stephen Colebourne/a
  + * @author Michael Davey
* @version $Id$
*/
   public class StringUtilsIsTest extends TestCase {
  @@ -123,6 +124,31 @@
   assertEquals(false, StringUtils.isAlphanumericSpace(hkHKHik*khbkuh));
   }
   
  +public void testIsAsciiPrintable_String() {
  +assertEquals(false, StringUtils.isAsciiPrintable(null));
  +assertEquals(true, StringUtils.isAsciiPrintable());
  +assertEquals(true, StringUtils.isAsciiPrintable( ));
  +assertEquals(true, StringUtils.isAsciiPrintable(a));
  +assertEquals(true, StringUtils.isAsciiPrintable(A));
  +assertEquals(true, StringUtils.isAsciiPrintable(1));
  +assertEquals(true, StringUtils.isAsciiPrintable(Ceki));
  +assertEquals(true, StringUtils.isAsciiPrintable(!ab2c~));
  +assertEquals(true, StringUtils.isAsciiPrintable(1000));
  +assertEquals(true, StringUtils.isAsciiPrintable(10 00));
  +assertEquals(false, StringUtils.isAsciiPrintable(10\t00));
  +assertEquals(true, StringUtils.isAsciiPrintable(10.00));
  +assertEquals(true, StringUtils.isAsciiPrintable(10,00));
  +assertEquals(true, StringUtils.isAsciiPrintable(!ab-c~));
  +assertEquals(true, 
StringUtils.isAsciiPrintable(hkHK=Hik6i?UGH_KJgU7

cvs commit: jakarta-commons/lang project.xml

2004-02-24 Thread fredrik
fredrik 2004/02/24 14:38:55

  Modified:lang project.xml
  Log:
  Added a contributor.
  
  Revision  ChangesPath
  1.30  +3 -0  jakarta-commons/lang/project.xml
  
  Index: project.xml
  ===
  RCS file: /home/cvs/jakarta-commons/lang/project.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- project.xml   18 Feb 2004 23:13:37 -  1.29
  +++ project.xml   24 Feb 2004 22:38:55 -  1.30
  @@ -287,6 +287,9 @@
   contributor
 nameChris Webb/name
   /contributor
  +contributor
  +  nameMichael Davey/name
  +/contributor
 /contributors
 
 !-- Lang should depend on very little --
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang StringUtils.java

2004-02-18 Thread fredrik
fredrik 2004/02/18 14:32:50

  Modified:lang/src/java/org/apache/commons/lang StringUtils.java
  Log:
  Using isEmpty() internally.
  
  Revision  ChangesPath
  1.125 +32 -32
jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.124
  retrieving revision 1.125
  diff -u -r1.124 -r1.125
  --- StringUtils.java  16 Feb 2004 23:48:10 -  1.124
  +++ StringUtils.java  18 Feb 2004 22:32:50 -  1.125
  @@ -1,7 +1,7 @@
   /* 
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2004 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -383,7 +383,7 @@
*/
   public static String trimToNull(String str) {
   String ts = trim(str);
  -return (ts == null || ts.length() == 0 ? null : ts);
  +return (isEmpty(ts) ? null : ts);
   }
   
   /**
  @@ -523,7 +523,7 @@
* @return the stripped String, codenull/code if null String input
*/
   public static String strip(String str, String stripChars) {
  -if (str == null || str.length() == 0) {
  +if (isEmpty(str)) {
   return str;
   }
   str = stripStart(str, stripChars);
  @@ -753,7 +753,7 @@
* @since 2.0
*/
   public static int indexOf(String str, char searchChar) {
  -if (str == null || str.length() == 0) {
  +if (isEmpty(str)) {
   return -1;
   }
   return str.indexOf(searchChar);
  @@ -785,7 +785,7 @@
* @since 2.0
*/
   public static int indexOf(String str, char searchChar, int startPos) {
  -if (str == null || str.length() == 0) {
  +if (isEmpty(str)) {
   return -1;
   }
   return str.indexOf(searchChar, startPos);
  @@ -930,7 +930,7 @@
* @since 2.0
*/
   public static int lastIndexOf(String str, char searchChar) {
  -if (str == null || str.length() == 0) {
  +if (isEmpty(str)) {
   return -1;
   }
   return str.lastIndexOf(searchChar);
  @@ -964,7 +964,7 @@
* @since 2.0
*/
   public static int lastIndexOf(String str, char searchChar, int startPos) {
  -if (str == null || str.length() == 0) {
  +if (isEmpty(str)) {
   return -1;
   }
   return str.lastIndexOf(searchChar, startPos);
  @@ -1056,7 +1056,7 @@
* @since 2.0
*/
   public static boolean contains(String str, char searchChar) {
  -if (str == null || str.length() == 0) {
  +if (isEmpty(str)) {
   return false;
   }
   return (str.indexOf(searchChar) = 0);
  @@ -1115,7 +1115,7 @@
* @since 2.0
*/
   public static int indexOfAny(String str, char[] searchChars) {
  -if (StringUtils.isEmpty(str) || searchChars == null || searchChars.length 
== 0) {
  +if (isEmpty(str) || searchChars == null || searchChars.length == 0) {
   return -1;
   }
   for (int i = 0; i  str.length(); i++) {
  @@ -1152,7 +1152,7 @@
* @since 2.0
*/
   public static int indexOfAny(String str, String searchChars) {
  -if (StringUtils.isEmpty(str) || StringUtils.isEmpty(searchChars)) {
  +if (isEmpty(str) || isEmpty(searchChars)) {
   return -1;
   }
   return indexOfAny(str, searchChars.toCharArray());
  @@ -1183,7 +1183,7 @@
* @since 2.0
*/
   public static int indexOfAnyBut(String str, char[] searchChars) {
  -if (str == null || str.length() == 0 || searchChars == null || 
searchChars.length == 0) {
  +if (isEmpty(str) || searchChars == null || searchChars.length == 0) {
   return -1;
   }
   outer : for (int i = 0; i  str.length(); i++) {
  @@ -1221,7 +1221,7 @@
* @since 2.0
*/
   public static int indexOfAnyBut(String str, String searchChars) {
  -if (str == null || str.length() == 0 || searchChars == null || 
searchChars.length() == 0) {
  +if (isEmpty(str) || isEmpty(searchChars)) {
   return -1;
   }
   for (int i = 0; i  str.length(); i++) {
  @@ -1722,7 +1722,7 @@
* @since 2.0
*/
   public static String substringBefore(String str, String separator) {
  -if (str == null || separator == null || str.length() == 0) {
  +if (isEmpty(str) || separator == null) {
   return str

cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/time FastDateFormatTest.java

2004-02-04 Thread fredrik
fredrik 2004/02/04 10:49:10

  Modified:lang/src/test/org/apache/commons/lang/time
FastDateFormatTest.java
  Log:
  Added test case for getDateInstance(int, Locale).
  Removed whitespaces from lines that was supposed to be empty.
  
  Revision  ChangesPath
  1.7   +35 -18
jakarta-commons/lang/src/test/org/apache/commons/lang/time/FastDateFormatTest.java
  
  Index: FastDateFormatTest.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/time/FastDateFormatTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FastDateFormatTest.java   18 Aug 2003 02:22:28 -  1.6
  +++ FastDateFormatTest.java   4 Feb 2004 18:49:10 -   1.7
  @@ -1,7 +1,7 @@
   /* 
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2004 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -54,6 +54,7 @@
   package org.apache.commons.lang.time;
   
   import java.text.SimpleDateFormat;
  +import java.util.Calendar;
   import java.util.Date;
   import java.util.GregorianCalendar;
   import java.util.Locale;
  @@ -69,6 +70,7 @@
*
* @author Sean Schofield
* @author a href=mailto:[EMAIL PROTECTED]Gary Gregory/a
  + * @author Fredrik Westermarck
* @since 2.0
* @version $Id$
*/
  @@ -108,7 +110,7 @@
   FastDateFormat format1 = FastDateFormat.getInstance(MM/DD/);
   FastDateFormat format2 = FastDateFormat.getInstance(MM-DD-);
   FastDateFormat format3 = FastDateFormat.getInstance(MM-DD-);
  -
  +
   assertTrue(format1 != format2); // -- junit 3.8 version -- 
assertFalse(format1 == format2);
   assertSame(format2, format3);
   assertEquals(MM/DD/, format1.getPattern());
  @@ -124,7 +126,7 @@
   try {
   Locale.setDefault(Locale.US);
   TimeZone.setDefault(TimeZone.getTimeZone(America/New_York));
  -
  +
   FastDateFormat format1 = FastDateFormat.getInstance(MM/DD/,
   TimeZone.getTimeZone(Atlantic/Reykjavik));
   FastDateFormat format2 = FastDateFormat.getInstance(MM/DD/);
  @@ -132,7 +134,7 @@
   FastDateFormat format4 = FastDateFormat.getInstance(MM/DD/, 
TimeZone.getDefault());
   FastDateFormat format5 = FastDateFormat.getInstance(MM-DD-, 
TimeZone.getDefault());
   FastDateFormat format6 = FastDateFormat.getInstance(MM-DD-);
  -
  +
   assertTrue(format1 != format2); // -- junit 3.8 version -- 
assertFalse(format1 == format2);
   assertEquals(TimeZone.getTimeZone(Atlantic/Reykjavik), 
format1.getTimeZone());
   assertEquals(true, format1.getTimeZoneOverridesCalendar());
  @@ -141,7 +143,7 @@
   assertSame(format3, format4);
   assertTrue(format3 != format5); // -- junit 3.8 version -- 
assertFalse(format3 == format5);
   assertTrue(format4 != format6); // -- junit 3.8 version -- 
assertFalse(format3 == format5);
  -
  +
   } finally {
   Locale.setDefault(realDefaultLocale);
   TimeZone.setDefault(realDefaultZone);
  @@ -159,7 +161,7 @@
   assertTrue(format1 != format2); // -- junit 3.8 version -- 
assertFalse(format1 == format2);
   assertSame(format1, format3);
   assertSame(Locale.GERMANY, format1.getLocale());
  -
  +
   } finally {
   Locale.setDefault(realDefaultLocale);
   }
  @@ -171,13 +173,13 @@
   try {
   Locale.setDefault(Locale.US);
   TimeZone.setDefault(TimeZone.getTimeZone(America/New_York));
  -
  +
   FastDateFormat format1 = FastDateFormat.getInstance(MM/DD/,
   TimeZone.getTimeZone(Atlantic/Reykjavik), Locale.GERMANY);
   FastDateFormat format2 = FastDateFormat.getInstance(MM/DD/, 
Locale.GERMANY);
   FastDateFormat format3 = FastDateFormat.getInstance(MM/DD/,
   TimeZone.getDefault(), Locale.GERMANY);
  -
  +
   assertTrue(format1 != format2); // -- junit 3.8 version -- 
assertNotSame(format1, format2);
   assertEquals(TimeZone.getTimeZone(Atlantic/Reykjavik), 
format1.getTimeZone());
   assertEquals(TimeZone.getDefault(), format2.getTimeZone());
  @@ -188,13 +190,13 @@
   assertEquals(Locale.GERMANY, format1.getLocale());
   assertEquals(Locale.GERMANY, format2.getLocale());
   assertEquals(Locale.GERMANY, format3.getLocale

Re: [lang] Validate - instanceof test?

2004-01-19 Thread Fredrik Westermarck
Michael Lanzetta wrote:

P.S.  I'm not a contributor, so does anyone have a pointer to the patch-submission process?
Hi!

Hava a look at http://jakarta.apache.org/commons/patches.html.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/time DateUtilsTest.java

2004-01-19 Thread fredrik
fredrik 2004/01/19 13:41:43

  Modified:lang/src/test/org/apache/commons/lang/time
DateUtilsTest.java
  Log:
  Fixed a couple of typos.
  
  Revision  ChangesPath
  1.11  +3 -3  
jakarta-commons/lang/src/test/org/apache/commons/lang/time/DateUtilsTest.java
  
  Index: DateUtilsTest.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/time/DateUtilsTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DateUtilsTest.java18 Aug 2003 02:22:28 -  1.10
  +++ DateUtilsTest.java19 Jan 2004 21:41:43 -  1.11
  @@ -1,7 +1,7 @@
   /* 
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2004 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -70,7 +70,7 @@
   import junit.textui.TestRunner;
   
   /**
  - * Unit tests [EMAIL PROTECTED] org.apache.commons.lang.CalendarUtils}.
  + * Unit tests [EMAIL PROTECTED] org.apache.commons.lang.time.DateUtils}.
*
* @author a href=mailto:[EMAIL PROTECTED]Serge Knystautas/a
* @author a href=mailto:[EMAIL PROTECTED]Steven Caswell/a
  @@ -93,7 +93,7 @@
   
   public static Test suite() {
TestSuite suite = new TestSuite(DateUtilsTest.class);
  - suite.setName(CalendarUtilsTest Tests);
  + suite.setName(DateUtils Tests);
   return suite;
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang ArrayUtilsTest.java

2004-01-19 Thread fredrik
fredrik 2004/01/19 13:50:06

  Modified:lang/src/java/org/apache/commons/lang ArrayUtils.java
   lang/src/test/org/apache/commons/lang ArrayUtilsTest.java
  Log:
  Added isEmpty for Object and primitives arrays. RFE in bugzilla (#26243).
  
  Revision  ChangesPath
  1.32  +129 -2
jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java
  
  Index: ArrayUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- ArrayUtils.java   8 Jan 2004 17:50:40 -   1.31
  +++ ArrayUtils.java   19 Jan 2004 21:50:06 -  1.32
  @@ -1,7 +1,7 @@
   /* 
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2004 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -80,6 +80,7 @@
* @author Pete Gieser
* @author Gary Gregory
* @author a href=mailto:[EMAIL PROTECTED]Ashwin S/a
  + * @author Fredrik Westermarck
* @since 2.0
* @version $Id$
*/
  @@ -2625,4 +2626,130 @@
   return result;
   }
   
  +// --
  +/**
  + * pChecks if an array of Objects is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final Object[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive longs is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final long[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive ints is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final int[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive shorts is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final short[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive chars is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final char[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive bytes is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final byte[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive doubles is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final double[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false;
  +}
  +
  +/**
  + * pChecks if an array of primitive floats is empty or codenull/code./p
  + *
  + * @param array  the array to test
  + * @return codetrue/code if the array is empty or codenull/code
  + * @since 2.1
  + */
  +public static boolean isEmpty(final float[] array) {
  +if (array == null || array.length == 0) {
  +return true;
  +}
  +return false

cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang ArrayUtils.java CharSetUtils.java Validate.java

2004-01-19 Thread fredrik
fredrik 2004/01/19 15:24:07

  Modified:lang/src/java/org/apache/commons/lang ArrayUtils.java
CharSetUtils.java Validate.java
  Log:
  Using ArrayUtils.isEmpty() when testing arrays.
  
  Revision  ChangesPath
  1.33  +9 -9  
jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java
  
  Index: ArrayUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- ArrayUtils.java   19 Jan 2004 21:50:06 -  1.32
  +++ ArrayUtils.java   19 Jan 2004 23:24:07 -  1.33
  @@ -1765,7 +1765,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int indexOf(final double[] array, final double valueToFind, int 
startIndex) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -1797,7 +1797,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int indexOf(final double[] array, final double valueToFind, int 
startIndex, double tolerance) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -1859,7 +1859,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int lastIndexOf(final double[] array, final double valueToFind, 
int startIndex) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -1893,7 +1893,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int lastIndexOf(final double[] array, final double valueToFind, 
int startIndex, double tolerance) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -1972,7 +1972,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int indexOf(final float[] array, final float valueToFind, int 
startIndex) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -2015,7 +2015,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int lastIndexOf(final float[] array, final float valueToFind, int 
startIndex) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -2075,7 +2075,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int indexOf(final boolean[] array, final boolean valueToFind, int 
startIndex) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  @@ -2118,7 +2118,7 @@
*  code-1/code if not found or codenull/code array input
*/
   public static int lastIndexOf(final boolean[] array, final boolean valueToFind, 
int startIndex) {
  -if (array == null || array.length == 0) {
  +if (ArrayUtils.isEmpty(array)) {
   return -1;
   }
   if (startIndex  0) {
  
  
  
  1.30  +6 -6  
jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
  
  Index: CharSetUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- CharSetUtils.java 4 Nov 2003 21:16:34 -   1.29
  +++ CharSetUtils.java 19 Jan 2004 23:24:07 -  1.30
  @@ -1,7 +1,7 @@
   /* 
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2004 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -154,7 +154,7 @@
* @return modified String, codenull/code if null string input
*/
   public static String squeeze(String str, String[] set) {
  -if (StringUtils.isEmpty(str) || set == null || set.length == 0) {
  +if (StringUtils.isEmpty(str) || ArrayUtils.isEmpty(set)) {
   return str;
   }
   CharSet chars

Re: [lang] DateRange

2004-01-14 Thread Fredrik Westermarck
Stephen Colebourne wrote:

You might want to consider the API of the Duration/Interval classes there as
part of this.
Hi!

Do you mean that you intend to donate the code of the Interval and 
Duration classes to commons-lang?

Regards,
Fredrik Westermarck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [lang] DateRange

2004-01-14 Thread Fredrik Westermarck
Stephen Colebourne wrote:

No, the joda-time library aims to replace the JDK date handling completely.
What [lang] should have is a simple date range based on the existing JDK
date code.
But you might find the ideas/API design useful in joda-time
Well, that's what I thought. But it's better to make sure first so that 
we don't reimplement things. :)

Regards,
Fredrik Westermarck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/math NumberUtils.java

2003-11-04 Thread fredrik
fredrik 2003/11/04 12:26:15

  Modified:lang/src/java/org/apache/commons/lang/math NumberUtils.java
  Log:
  Using StringUtils.isEmpty() when testing Strings.
  
  Revision  ChangesPath
  1.17  +3 -3  
jakarta-commons/lang/src/java/org/apache/commons/lang/math/NumberUtils.java
  
  Index: NumberUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/math/NumberUtils.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- NumberUtils.java  23 Sep 2003 17:02:10 -  1.16
  +++ NumberUtils.java  4 Nov 2003 20:26:14 -   1.17
  @@ -1314,7 +1314,7 @@
* @return codetrue/code if str contains only unicode numeric
*/
   public static boolean isDigits(String str) {
  -if ((str == null) || (str.length() == 0)) {
  +if (StringUtils.isEmpty(str)) {
   return false;
   }
   for (int i = 0; i  str.length(); i++) {
  @@ -1339,7 +1339,7 @@
* @return codetrue/code if the string is a correctly formatted number
*/
   public static boolean isNumber(String str) {
  -if ((str == null) || (str.length() == 0)) {
  +if (StringUtils.isEmpty(str)) {
   return false;
   }
   char[] chars = str.toCharArray();
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang RandomStringUtils.java

2003-11-04 Thread fredrik
fredrik 2003/11/04 12:31:45

  Modified:lang/src/java/org/apache/commons/lang RandomStringUtils.java
  Log:
  Split a long method declaration into two lines to keep checkstyle happy.
  
  Revision  ChangesPath
  1.26  +3 -2  
jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java
  
  Index: RandomStringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- RandomStringUtils.java7 Sep 2003 14:32:34 -   1.25
  +++ RandomStringUtils.java4 Nov 2003 20:31:45 -   1.26
  @@ -252,7 +252,8 @@
* @throws IllegalArgumentException if codecount/code lt; 0.
* @since 2.0
*/
  -public static String random(int count, int start, int end, boolean letters, 
boolean numbers, char[] chars, Random random) {
  +public static String random(int count, int start, int end, boolean letters, 
boolean numbers,
  +char[] chars, Random random) {
   if (count == 0) {
   return ;
   } else if (count  0) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang StringUtils.java

2003-11-04 Thread fredrik
fredrik 2003/11/04 13:00:22

  Modified:lang/src/java/org/apache/commons/lang StringUtils.java
  Log:
  Using StringUtils.isEmpty() when testing Strings.
  Renamed the parameter string to the more commonly used str in removeStart() and 
removeEnd.
  
  Revision  ChangesPath
  1.117 +15 -15
jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- StringUtils.java  3 Nov 2003 03:48:59 -   1.116
  +++ StringUtils.java  4 Nov 2003 21:00:22 -   1.117
  @@ -1114,7 +1114,7 @@
* @since 2.0
*/
   public static int indexOfAny(String str, char[] searchChars) {
  -if (str == null || str.length() == 0 || searchChars == null || 
searchChars.length == 0) {
  +if (StringUtils.isEmpty(str) || searchChars == null || searchChars.length 
== 0) {
   return -1;
   }
   for (int i = 0; i  str.length(); i++) {
  @@ -1151,7 +1151,7 @@
* @since 2.0
*/
   public static int indexOfAny(String str, String searchChars) {
  -if (str == null || str.length() == 0 || searchChars == null || 
searchChars.length() == 0) {
  +if (StringUtils.isEmpty(str) || StringUtils.isEmpty(searchChars)) {
   return -1;
   }
   return indexOfAny(str, searchChars.toCharArray());
  @@ -2485,14 +2485,14 @@
*  codenull/code if null String input
* @since 2.1
*/
  -public static String removeStart(String string, String remove) {
  -if (string == null || string.length() == 0 || remove == null || 
remove.length() == 0) {
  -return string;
  +public static String removeStart(String str, String remove) {
  +if (StringUtils.isEmpty(str) || StringUtils.isEmpty(remove)) {
  +return str;
   }
  -if (string.startsWith(remove)){
  -return string.substring(remove.length());
  +if (str.startsWith(remove)){
  +return str.substring(remove.length());
   }
  -return string;
  +return str;
   }
   
   /**
  @@ -2519,14 +2519,14 @@
*  codenull/code if null String input
* @since 2.1
*/
  -public static String removeEnd(String string, String remove) {
  -if (string == null || string.length() == 0 || remove == null || 
remove.length() == 0) {
  -return string;
  +public static String removeEnd(String str, String remove) {
  +if (StringUtils.isEmpty(str) || StringUtils.isEmpty(remove)) {
  +return str;
   }
  -if (string.endsWith(remove)) {
  -return string.substring(0, string.length() - remove.length());
  +if (str.endsWith(remove)) {
  +return str.substring(0, str.length() - remove.length());
   }
  -return string;
  +return str;
   }
   
   // Replacing
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang CharSetUtils.java

2003-11-04 Thread fredrik
fredrik 2003/11/04 13:16:34

  Modified:lang/src/java/org/apache/commons/lang CharSetUtils.java
  Log:
  Converting some chars  in javadoc into html-enteties.
  
  Revision  ChangesPath
  1.29  +10 -10
jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
  
  Index: CharSetUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- CharSetUtils.java 24 Sep 2003 20:22:33 -  1.28
  +++ CharSetUtils.java 4 Nov 2003 21:16:34 -   1.29
  @@ -89,7 +89,7 @@
* ul
*  liquot;aeioquot; which implies 'a','e',../li
*  liquot;^equot; implies not e./li
  - *  liquot;ej-mquot; implies e,j-m. e,j,k,l,m./li
  + *  liquot;ej-mquot; implies e,j-gt;m. e,j,k,l,m./li
* /ul
* 
* pre
  @@ -246,8 +246,8 @@
* CharSetUtils.keep(, *)  = 
* CharSetUtils.keep(*, null)= 
* CharSetUtils.keep(*, )  = 
  - * CharSetUtils.keep(hello, hl) = hll
  - * CharSetUtils.keep(hello, le) = ell
  + * CharSetUtils.keep(hello, hl)  = hll
  + * CharSetUtils.keep(hello, le)  = ell
* /pre
*
* @see #evaluateSet(java.lang.String[]) for set-syntax.
  @@ -305,8 +305,8 @@
* CharSetUtils.delete(, *)  = 
* CharSetUtils.delete(*, null)= *
* CharSetUtils.delete(*, )  = *
  - * CharSetUtils.delete(hello, hl) = hll
  - * CharSetUtils.delete(hello, le) = ell
  + * CharSetUtils.delete(hello, hl)  = hll
  + * CharSetUtils.delete(hello, le)  = ell
* /pre
*
* @see #evaluateSet(java.lang.String[]) for set-syntax.
  @@ -369,7 +369,7 @@
* pAn example is:/p
* ul
*   litranslate(quot;helloquot;, quot;hoquot;, quot;jyquot;)
  - *= jelly/li
  + *=gt; jelly/li
* /ul
*
* pIf the length of characters to search for is greater than the
  @@ -378,16 +378,16 @@
* 
* pre
* CharSetUtils.translate(null, *, *) = null
  - * CharSetUtils.translate(, *, *) = 
  + * CharSetUtils.translate(, *, *)   = 
* /pre
*
* @param str  String to replace characters in, may be null
* @param searchChars   a set of characters to search for, must not be null
  - * @param replaceChars  a set of characters to replace, must not be null or 
empty ()
  + * @param replaceChars  a set of characters to replace, must not be null or 
empty (quot;quot;)
* @return translated String, codenull/code if null string input
* @throws NullPointerException if codewith/code or coderepl/code 
*  is codenull/code
  - * @throws ArrayIndexOutOfBoundsException if codewith/code is empty ()
  + * @throws ArrayIndexOutOfBoundsException if codewith/code is empty 
(quot;quot;)
* @deprecated Use [EMAIL PROTECTED] StringUtils#replaceChars(String, String, 
String)}.
* Method will be removed in Commons Lang 3.0.
*/
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] Removing code from deprecated NumberUtils

2003-09-25 Thread Fredrik Westermarck
Hi!

Yes, the methods behave exaclty the same.

However if the new methods change later on and before the deprecated 
class is removed, that could mean that we would have to bring back the 
old implementation in the deprecated class from the CVS. Keeping track 
of when that occurs could also be difficult.

I guess thats one of the reasons (and a good one too) not to change the 
methods.

Stephen Colebourne wrote:
We can't delete it yet, so the general approach has been to leave alone so
that we guarantee it still works the way it used to.
However, if you are certain that these methods do exactly the same, then a
forwarding implementation would be OK.
Stephen
Since lang.NumberUtils is deprecated, I don't see a point in making any
modifications to it.
Fredrik Westermarck wrote:

How about removing tha code in o.a.c.lang.NumberUtils and dispatching
calls to the corresponding method in o.a.c.lang.math.NumberUtils
instead?

Maybe not all methods can be changed this way since nullhandling and
throwing of exceptions may have changed.
After having a quick look it seems as the following methods in in
o.a.c.lang.NumberUtils could be changed this way:
- stringToInt(String)/stringToInt(String, int)
- isAllZeros(String)
- minimum(long, long, long)/minimum(int, int, int)
- maximum(long, long, long)/maximum(int, int, int)
- compare(double, double)/compare(float, float)
- isDigits(String)
- isNumber(String)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang BooleanUtils.java

2003-09-23 Thread fredrik
fredrik 2003/09/23 12:45:14

  Modified:lang/src/java/org/apache/commons/lang BooleanUtils.java
  Log:
  Added examples in javadoc.
  
  Revision  ChangesPath
  1.16  +196 -8
jakarta-commons/lang/src/java/org/apache/commons/lang/BooleanUtils.java
  
  Index: BooleanUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/BooleanUtils.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BooleanUtils.java 7 Sep 2003 14:32:34 -   1.15
  +++ BooleanUtils.java 23 Sep 2003 19:45:14 -  1.16
  @@ -86,6 +86,12 @@
* pNegates the specified boolean./p
* 
* pIf codenull/code is passed in, codenull/code will be returned./p
  + *
  + * pre
  + *   BooleanUtils.negate(Boolean.TRUE)  = Boolean.FALSE;
  + *   BooleanUtils.negate(Boolean.FALSE) = Boolean.TRUE;
  + *   BooleanUtils.negate(null)  = null;
  + * /pre
* 
* @param bool  the Boolean to negate, may be null
* @return the negated Boolean, or codenull/code if codenull/code input
  @@ -103,7 +109,12 @@
* pBoolean factory that avoids creating new Boolean objecs all the time./p
* 
* pThis method was added to JDK1.4 but is available here for earlier 
JDKs./p
  - * 
  + *
  + * pre
  + *   BooleanUtils.toBooleanObject(false) = Boolean.FALSE
  + *   BooleanUtils.toBooleanObject(true)  = Boolean.TRUE
  + * /pre
  + *
* @param bool  the boolean to convert
* @return Boolean.TRUE or Boolean.FALSE as appropriate
*/
  @@ -114,7 +125,13 @@
   /**
* pConverts a Boolean to a boolean handling codenull/code
* by returning codefalse/code./p
  - * 
  + *
  + * pre
  + *   BooleanUtils.toBoolean(Boolean.TRUE)  = true
  + *   BooleanUtils.toBoolean(Boolean.FALSE) = false
  + *   BooleanUtils.toBoolean(null)  = false
  + * /pre
  + *
* @param bool  the boolean to convert
* @return codetrue/code or codefalse/code, 
*  codenull/code returns codefalse/code
  @@ -129,6 +146,12 @@
   /**
* pConverts a Boolean to a boolean handling codenull/code./p
* 
  + * pre
  + *   BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE, false) = true
  + *   BooleanUtils.toBooleanDefaultIfNull(Boolean.FALSE, true) = false
  + *   BooleanUtils.toBooleanDefaultIfNull(null, true)  = true
  + * /pre
  + *
* @param bool  the boolean to convert
* @param valueIfNull  the boolean value to return if codenull/code
* @return codetrue/code or codefalse/code
  @@ -146,6 +169,12 @@
* pConverts an int to a boolean using the convention that codezero/code
* is codefalse/code./p
* 
  + * pre
  + *   BooleanUtils.toBoolean(0) = false
  + *   BooleanUtils.toBoolean(1) = true
  + *   BooleanUtils.toBoolean(2) = true
  + * /pre
  + *
* @param value  the int to convert
* @return codetrue/code if non-zero, codefalse/code
*  if zero
  @@ -158,6 +187,12 @@
* pConverts an int to a Boolean using the convention that codezero/code
* is codefalse/code./p
* 
  + * pre
  + *   BooleanUtils.toBoolean(0) = Boolean.FALSE
  + *   BooleanUtils.toBoolean(1) = Boolean.TRUE
  + *   BooleanUtils.toBoolean(2) = Boolean.TRUE
  + * /pre
  + *
* @param value  the int to convert
* @return Boolean.TRUE if non-zero, Boolean.FALSE if zero,
*  codenull/code if codenull/code
  @@ -171,7 +206,13 @@
* is codefalse/code./p
* 
* pcodenull/code will be converted to codenull/code./p
  - * 
  + *
  + * pre
  + *   BooleanUtils.toBoolean(new Integer(0))= Boolean.FALSE
  + *   BooleanUtils.toBoolean(new Integer(1))= Boolean.TRUE
  + *   BooleanUtils.toBoolean(new Integer(null)) = null
  + * /pre
  + *
* @param value  the Integer to convert
* @return Boolean.TRUE if non-zero, Boolean.FALSE if zero,
*  codenull/code if codenull/code input
  @@ -186,6 +227,13 @@
   /**
* pConverts an int to a boolean specifying the conversion values./p
* 
  + * pre
  + *   BooleanUtils.toBoolean(0, 1, 0) = false
  + *   BooleanUtils.toBoolean(1, 1, 0) = true
  + *   BooleanUtils.toBoolean(2, 1, 2) = false
  + *   BooleanUtils.toBoolean(2, 2, 0) = true
  + * /pre
  + *
* @param value  the Integer to convert
* @param trueValue  the value to match for codetrue/code
* @param falseValue  the value to match for codefalse/code
  @@ -205,6 +253,14 @@
   /**
* pConverts an Integer to a boolean specifying the conversion values./p
* 
  + * pre
  + *   BooleanUtils.toBoolean(new Integer(0), new

cvs commit: jakarta-commons/lang STATUS.html

2003-09-23 Thread fredrik
fredrik 2003/09/23 12:51:04

  Modified:lang STATUS.html
  Log:
  Removed todo that has been adressed.
  
  Revision  ChangesPath
  1.52  +1 -2  jakarta-commons/lang/STATUS.html
  
  Index: STATUS.html
  ===
  RCS file: /home/cvs/jakarta-commons/lang/STATUS.html,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- STATUS.html   22 Sep 2003 13:38:00 -  1.51
  +++ STATUS.html   23 Sep 2003 19:51:04 -  1.52
  @@ -127,7 +127,6 @@
   pWant to help?  Here's some to do items the team has identified as possibly 
being in scope for Lang.
   Note that all are still under discussion, so please mail the list before 
actioning./p
   ul
  -liRename NumberUtils stringToInt() et al to toInt()./li
   liDateRange/Duration class./li
   liDurationFormatUtils to be completed and made public./li
   liCloneUtils - utility class to enable cloning via various different 
mechanisms./li
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] Codestyle (Was: [lang] [patch] Conversion of String to long/double)

2003-09-08 Thread Fredrik Westermarck
Phil Steitz wrote:
Strangely, the checkstyle plugin is not complaining about any tabs in 
the code.  Are you finding these in the tests or in the /java sources?
The differences is mainly in lines that are blank.
In the cvs these lines contains 6 whitespace chars and there are no 
whitespaces in my local files. These differences are present both in 
NumberUtils and in NumberUtilsTest.
Did you update after the first commit?  I did remove one blank line and 
added braces around an if() construct before committing the first patch. 
 I noticed that the missing braces were present in the second patch.
Yes, I did make an cvs update after the first commit.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [lang] [patch] Conversion of String to long/double

2003-09-08 Thread Fredrik Westermarck
Stephen Colebourne wrote:

Do we feel that the stringToInt() naming is good for these methods?

BooleanUtils uses toBoolean(), which is shorter and fits better with JDK
standards. Thus
toInt(String)
toLong(String)
etc.
Opinions?
I agree that the toType methodname is better.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [lang] Codestyle (Was: [lang] [patch] Conversion of String to long/double)

2003-09-05 Thread Fredrik Westermarck
Phil Steitz wrote:

Strangely, the 
checkstyle plugin is not complaining about any tabs in the code.  Are 
you finding these in the tests or in the /java sources?
The differences is mainly in lines that are blank.

In the cvs these lines contains 6 whitespace chars and there are no 
whitespaces in my local files. These differences are present both in 
NumberUtils and in NumberUtilsTest.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[lang] [patch] Conversion of String to long/double

2003-09-04 Thread Fredrik Westermarck
Hi!

Here is the patch that adds stringToLong(String str), 
stringToLong(String str, long), stringToDouble(String str) and 
stringToDouble(String str, double), testcases are also included.

I have also improved the testcase for stringToFloat(String).

Hopefully I managed to get the diff right. I had to remove several lines 
by hand because of differences in the indentation (space vs tabs?). Is 
there any document that describes what codestyle commons-lang is 
supposed to use?


commons-lang-NumberUtils.zip
Description: Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

[lang] Codestyle (Was: [lang] [patch] Conversion of String to long/double)

2003-09-04 Thread Fredrik Westermarck
Henri Yandell wrote:

Hopefully I managed to get the diff right. I had to remove several lines
by hand because of differences in the indentation (space vs tabs?). Is
there any document that describes what codestyle commons-lang is
supposed to use?
In the long term, a maven site and checkstyle might enforce this, but in
real terms the codestyle to use is the same as the nearest neighbour.
Since I haven't used maven yet, will it still be possible to build with 
ant only?

So if you're adding a method to NumberUtils, follow the style of
NumberUtils. If you're adding a new class to lang.time, follow the style
of a core class in lang.time. If you're adding a new package, you should
have a good general feel for the style already :)

 Basic rules of working on a community codebase I guess.
I used the same codestyle this time as for my previous patch to 
NumberUtils. When creating the diff for my previous patch I didn't have 
any problem with the indentation so I guess that the codestyle for the 
class changed when Phil commited it... :)

There are some basic concepts in the DESIGN-GUIDE file which state how
XxxUtils classes should be, and there is a checkstyle.xml in there, if you
know how to read that.
No, I don't know how checkstyle.xml works, but it never too late to 
learn... I'll have a look at them and try to create a codestyle for my IDE.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[lang] [patch] Conversion of String to float

2003-09-02 Thread Fredrik Westermarck
Hi!

Here is a patch that adds stringToFloat(String) and 
stringToFloat(String, float) in o.a.c.lang.math.NumberUtils (including 
testcases in NumberUtilsTest).




commons-lang-NumberUtils.zip
Description: Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

[lang] [patch] Javadoc fixes

2003-08-04 Thread Fredrik Westermarck
Hi!

Here is a patch that corrects some Javadoc in CharRange, CharSet, 
CharSetUtils, IntRange, DateUtils and FastDateFormat.


lang.zip
Description: Zip archive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [lang] Javadocfixes and minor changes

2003-07-08 Thread Fredrik Westermarck
Fredrik Westermarck wrote:
I will send some more patches mostly javadoc formatting later on today.
Hi!

Here are the promised patches.

I have fixed some javadoc (mostly formatting) in alot of classes and in 
ReflectionUtils changed to appending a char to the StringBuffer instead 
of a single char String.

I also discovered some other issues while fixing the javadoc:

- Several classes does test Strings on it own instead of using
  StringUtils.isEmpty() or StringUtils.isNotEmpty(), is that a
  deliberate design decision?
- Some variable and method javadoc is missing especially in
  the Fraction and RandomUtils classes.
- Alot of @parameter and @return javadoc is missing.


lang.zip
Description: Zip archive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

[lang] Javadocfixes and minor changes

2003-07-07 Thread Fredrik Westermarck
Hi!

The following patch includes some javadoc fixes (RandomStringUtils, 
StringEscapeUtils, StringUtils, SystemUtils and WordWrapUtils), mostly 
formatting. In StringUtils I also changed rightPad(String, int), 
leftPad(String, int) and leftPad(String, int, char) to use ' ' instead 
of   when calling left-/rightPad.

I found some incomplete javadoc in StringUtils for join(Object[] array, 
char separator) and join(Iterator iterator, char separator).

In WordWrapUtils the parameter split is never used in wordWrap(String, 
int, String, String).



lang.zip
Description: Zip archive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to get access to individual chunks in chunked response?

2003-03-13 Thread Fredrik Herbertsson


Hi Oleg!

After sending the mail, I started to question my design myself. Of course, my
application stuff has nothing to do with the HTTP transport. Chunked encoding is
(as you say) a TRANSFER encoding, which an application should have NO knowledge
of the internal workings of. To make some application logic dependant on the
inner workings of the transport protocol is, to be polite, not so good :-).

Now, the client sends a request asking if something has changed, if so it will
be notified immediately otherwise the response-channel will be kept alive until
a notification is due.


Sorry for taking up your time with my rather 'stupid' design.

Regards

/Fredrik



|+
||  Kalnichevski, Oleg  |
||  [EMAIL PROTECTED]|
||  point.com|
|||
||  2003-03-13 15:06  |
||  Please respond to Commons|
||  HttpClient Project   |
|||
|+
  |
  ||
  |  To: Commons HttpClient Project  |
  |   [EMAIL PROTECTED]  |
  |  cc: (bcc: Fredrik Herbertsson/OMT/OMGROUP)|
  |  Subject: RE: How to get access to individual chunks in chunked|
  |   response?|
  |




Fredrik,

We have striven to make transfer encoding absolutely transparent to the client.
We have never envisaged direct access to individual chunks of chunk-encoded
data.

I may be wrong here, but let me express my personal opinion on this matter.
Please bear in mind HTTP protocol has been designed to be stateless,
request/response oriented (with cookies being a very clumsy attempt at adding
session persistence later on). I doubt that HTTP protocol is well suited for
implementing any sort of notification channel. I suggest you reconsider your
design and probably use good ol' polling instead, rather than getting very
creative with the use of chunk encoding

Cheers

Oleg

-Original Message-
From: Fredrik Herbertsson [mailto:[EMAIL PROTECTED]
Sent: Donnerstag, 13. März 2003 13:27
To: [EMAIL PROTECTED]
Subject: How to get access to individual chunks in chunked response?




HI,

Is it possible using HttpClient to get access to individual chunks in an chunked
response?
Further, does the HTTP standard allow a HTTP-server to send MORE than one (full,
i.e. last chunk of size 0 sent) HTTP/1.1 200 responses for one request?

The problem I'm trying to solve is to make a request on a particular connection,
get a response (including data I need. In my case an application session id) and
then further wait for an application notification. The mentioned connection is a
notification channel used to notify client when certain application events
occur.

 I've been looking at the source for the ChunkedInputStream and as far as I can
see it is not possible to get hold of the chunks. (As it probably shouldn't be
since the stream is supposed to abstract stuff like that away :-). I only seem
ta have access to the full response. Is it possible to receive another (chunked)
response on the used InputStream? I't looks that the EOF flag is set when the
Last-Chunk is received and successive calls to read will immediately return -1,
making the stream useless for further responses. Is it possible to re-use the
connection (underlying Socket) and get a stream that reads from the same
underlying connection?

... or do I have to use 'raw' sockets on the client-side and parse the response
including the HTTP stuff :-(

Regards
/Fredrik Herbertsson



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Javdoc formatting (Was: [lang] [patch] Javadoc improvements)

2002-11-19 Thread Fredrik Westermarck
Henri Yandell wrote:

I'm all for having consistent javadoc. Feel like writing up the 'rules'
for the javadoc style you've ended up on? 

Hi!

Here is the promised rules that I try to follow when writing javadoc.

Ofcourse the Sun javadoc guidelines is used, this is only to be seen as 
an extension of them to make it easier for users reading the generated 
docs and developers with javadoc-popup capabilities from within their IDE.

General:
References to other objects, interfaces or methods use the @link-tag the 
first time it is referenced in a class or interface. On the following 
references always enclose it inside code/code.

Classes/Interfaces/Methods:
Use a short description of what the class/interface/metod is used for, 
enclose with p/p.

A longer description about what the class/interface/metod is used for 
and if it is needed how it is done. If it is nessesary include 
description of the parameters, what they are used for and how. Enclose 
with p/p where it is needed, try to divide into smaller parts (not 
to small!) to enhance readability of the generated Javadoc.

If an example is needed enclose it with ppre/pre/p.
If an example was given write an explanation of the example within p/p.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



Re: [lang] [patch] Javadoc improvements

2002-11-16 Thread Fredrik Westermarck
Stephen Colebourne wrote:

Patch applied. (We haven't actually agreed on a format for p /p html
tags in javadoc, but I decided that there was other useful formatting in the
patch as well - actually since this is committed, now a decision on the
style is probably effectively taken for lang ;-).


When browsing the generated Javadoc I realized that the formatting was 
diffrent depending who had written the class or method. Therefore I felt 
that it's better to have one consistent formatting, that later on can be 
changed if it is needed.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



Re: [lang] [patch] Javadoc improvements

2002-11-16 Thread Fredrik Westermarck
Henri Yandell wrote:

I'm all for having consistent javadoc. Feel like writing up the 'rules'
for the javadoc style you've ended up on?


Sure, I can always try to document it. I'll just want to finish the 
changes in the javadoc for o.a.c.lang.builder first.

[From the files often changed I suspect I'm the biggest offender and I'd like to stop offending :)]


Since it's always easier to review someone elses code or javadoc, I 
don't blame you - or anyone else for that matter. :)


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



[lang] [patch] Javadoc improvements

2002-11-15 Thread Fredrik Westermarck
Hi!

Here is a patch where I have added formatting to the Javadoc (only for 
the classes in o.a.c.lang not in the subpackages) so that the generated 
Javadoc is easier to read. Some typos was also fixed.

--
To unsubscribe, e-mail:   mailto:commons-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:commons-dev-help;jakarta.apache.org


Re: [lang] [patch] Javadoc

2002-11-14 Thread Fredrik Westermarck
Stephen Colebourne wrote:

I tried to apply the patch, but it failed, so I've done it mostly by hand
instead. You may want to check the CVS again ;-)


Hi!

I've attached a new patch with the most obvious changes that was missed. :)

Index: StringUtils.java
===
RCS file: 
/home/cvspublic/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
retrieving revision 1.22
diff -r1.22 StringUtils.java
1530c1530
  * param str the Object to check
---
  * param obj the Object to check
Index: ArrayUtils.java
===
RCS file: 
/home/cvspublic/jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java,v
retrieving revision 1.2
diff -r1.2 ArrayUtils.java
400c400,401
  * param true if length of arrays matches, treating codenull/code as an 
empty array
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
418,419c419,421
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
436,437c438,440
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
454,455c457,459
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
472,473c476,478
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
490,491c495,497
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
508,509c514,516
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
526,527c533,535
  * param true if length of arrays matches, treating codenull/code as an 
empty array
  */
---
  * return codetrue/code if length of arrays matches, treating
  *  codenull/code as an empty array
  */
543c551
  * param true if type of arrays matches
---
  * return codetrue/code if type of arrays matches


--
To unsubscribe, e-mail:   mailto:commons-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:commons-dev-help;jakarta.apache.org


Re: [lang] [patch] Javadoc

2002-11-14 Thread Fredrik Westermarck
Stephen Colebourne wrote:

Unfortunately its the patch format thats wrong (Eclipse doesn't like it).
See:
http://jakarta.apache.org/commons/patches.html

(I think its the -u you're missing)


You're right, I did miss the -u switch. Thats what happens when you try 
to use an GUI-application... :)
Index: StringUtils.java
===
RCS file: 
/home/cvspublic/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
retrieving revision 1.22
diff -u -r1.22 StringUtils.java
--- StringUtils.java14 Nov 2002 22:29:25 -  1.22
+++ StringUtils.java15 Nov 2002 00:12:53 -
 -1527,7 +1527,7 
  * Returns either the passed in Object as a String, or,
  * if the Object is codenull/code, an empty String.
  * 
- * param str the Object to check
+ * param obj the Object to check
  * return the passed in Object's toString, or blank if it was null
  */
 public static String defaultString(Object obj) {
Index: ArrayUtils.java
===
RCS file: 
/home/cvspublic/jakarta-commons/lang/src/java/org/apache/commons/lang/ArrayUtils.java,v
retrieving revision 1.2
diff -u -r1.2 ArrayUtils.java
--- ArrayUtils.java 14 Nov 2002 22:29:25 -  1.2
+++ ArrayUtils.java 15 Nov 2002 00:12:53 -
 -397,7 +397,8 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
+ * return codetrue/code if length of arrays matches, treating
+ *  codenull/code as an empty array
  */
 public static boolean isSameLength(Object[] array1, Object[] array2) {
 if ((array1 == null  array2 != null  array2.length  0) ||
 -415,8 +416,9 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
- */
+ * return codetrue/code if length of arrays matches, treating
+ *  codenull/code as an empty array
+ */
 public static boolean isSameLength(long[] array1, long[] array2) {
 if ((array1 == null  array2 != null  array2.length  0) ||
 (array2 == null  array1 != null  array1.length  0) ||
 -433,8 +435,9 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
- */
+ * return codetrue/code if length of arrays matches, treating
+ *  codenull/code as an empty array
+ */
 public static boolean isSameLength(int[] array1, int[] array2) {
 if ((array1 == null  array2 != null  array2.length  0) ||
 (array2 == null  array1 != null  array1.length  0) ||
 -451,8 +454,9 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
- */
+ * return codetrue/code if length of arrays matches, treating
+ *  codenull/code as an empty array
+ */
 public static boolean isSameLength(short[] array1, short[] array2) {
 if ((array1 == null  array2 != null  array2.length  0) ||
 (array2 == null  array1 != null  array1.length  0) ||
 -469,8 +473,9 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
- */
+ * return codetrue/code if length of arrays matches, treating
+ *  codenull/code as an empty array
+ */
 public static boolean isSameLength(byte[] array1, byte[] array2) {
 if ((array1 == null  array2 != null  array2.length  0) ||
 (array2 == null  array1 != null  array1.length  0) ||
 -487,8 +492,9 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
- */
+ * return codetrue/code if length of arrays matches, treating
+ *  codenull/code as an empty array
+ */
 public static boolean isSameLength(double[] array1, double[] array2) {
 if ((array1 == null  array2 != null  array2.length  0) ||
 (array2 == null  array1 != null  array1.length  0) ||
 -505,8 +511,9 
  * 
  * param array1 the first array, may be codenull/code
  * param array2 the second array, may be codenull/code
- * param true if length of arrays matches, treating codenull/code as an 
empty array
- */
+ * return codetrue/code 

Re: [lang][patch] StringUtils

2002-10-19 Thread Fredrik Westermarck
Fredrik Westermarck wrote:

Hi!

I have attached a patch that improves the javadoc in StringUtils.


Please review the patch and commit it if it meet the standards.

--
Fredrik Westermarck


--
To unsubscribe, e-mail:   mailto:commons-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:commons-dev-help;jakarta.apache.org




[lang][patch] ExceptionUtils

2002-10-03 Thread Fredrik Westermarck

Hi!

In the attached patch I have fixed the TODO that was in the method 
getStackFrames(String).


ExceptionUtils.java.diff
Description: Binary data

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[lang] [patch] Removal of unused imports

2002-09-29 Thread Fredrik Westermarck

Hi!

Here is a patch where I have removed unused imports in o.a.c.lang.

Regards,
Fredrik Westermarck


lang.diff
Description: Binary data

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[lang][patch] StringUtils

2002-09-29 Thread Fredrik Westermarck

Hi!

Here is a patch where I have fixed a typo in javadoc and removed some unused 
code in StringUtils.

Regards,
Fredrik Westermarck


StringUtils.diff
Description: Binary data

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[lang][PATCH] StringUtils

2002-09-18 Thread Fredrik Westermarck

Hi!

Here is a patch for the StringUtils class with a containsOnly-method. 
Well actually it's two patches since I also added testcases.

Fredrik Westermarck



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Re: [lang][PATCH] StringUtils

2002-09-18 Thread Fredrik Westermarck

Fredrik Westermarck wrote:
 Hi!
 
 Here is a patch for the StringUtils class with a containsOnly-method. 
 Well actually it's two patches since I also added testcases.

Since Mozilla tries to inline attachments they somehow got lost. I 
packaged them in a zip-file instead. Hopefully that it will work. :)

Fredrik Westermarck



patches.zip
Description: Zip compressed data

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Re: jarlib-* tasks

2002-04-05 Thread Fredrik Lindgren

I think a nice thing to have would be an extension or update to the 
Available task to enable checking if an implementation of an extension 
is available. If it could also check for versions it would be even 
better. It could use the rules described for applet jars in 
http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html

It could look something like:
jarlib-available property=ant-available 
extension-name=org.apache.tools.ant specification-version=1.4.9 
implementation-version=1.4.9
fileset dir=../../
include name=lib/*.jar/
/fileset
/jarlib-available

Any comments?

/Fredrik Lindgren




Peter Donald wrote:

 Hi,
 
 Over last few days I have been working on extracting some tasks from another 
 project I was working on. These tasks basically aimed at helping manage 
 Optional Packages (previously known as Extensions and before that 
 Standard Extensions). These are basically the standard library format for 
 most of newer specifications (servlet, ejb etc).
 
 Basically what these specifications demand is a certain set of attributes in 
 a jars manifest. One example of attributes required for an extension would be
 
 Extension-Name: org.realityforge.dve 
 Specification-Version: 1.0 
 Specification-Vendor: Peter Donald 
 
 Which declares a basic extension. You can read more about these extension 
 specifications at 
 
 http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html. 
 
 or at
 
 http://jakarta.apache.org/ant/myrmidon/librarys.html
 
 under dependencies.
 
 Anyhow I have got two basic tasks going in myrmidon that I will backport to 
 ant1.x and these are; jarlib-display and jarlib-manifest
 
 * jarlib-display: this task will basically display all the Extensions a task
   implements or depends upon. It also displays the Package Specification that 
   a library implements. Some examples of task in action would be
 
 jarlib-display file=../../src/ant1compat/jar/ant.jar/ 
 jarlib-display 
 fileset dir=../../ 
 include name=src/ant1compat/jar/*.jar/ 
 include name=lib/*.jar/ 
 /fileset 
 /jarlib-display 
 
   The first would display only the information  in single jar while second 
 form would display information in all the jars. The information comes out 
 looking somethin like
   
 --
 File: 
 /mnt/dos-e/projects/jakarta-ant/proposal/myrmidon/src/ant1compat/jar/ant.jar
 --
 Extensions Supported By Library:
 Extension-Name: org.apache.tools.ant
 Specification-Version: 1.4.9
 Specification-Vendor: Apache Software Foundation
 Implementation-Version: 1.4.9
 Implementation-Vendor: Apache Software Foundation
 
 Specifications Supported By Library:
 Sections:  org/apache/tools/ant
 Specification-Title: Apache Ant
 Specification-Version: 1.4.9
 Specification-Vendor: Apache Software Foundation
 Implementation-Title: org.apache.tools.ant
 Implementation-Version: 1.4.9
 Implementation-Vendor: Apache Software Foundation
 
 * jarlib-manifest: this task aims to make it easier to generate manifest that 
 contain all the correct dependency information. An example invocation of taks 
 would be 
 
 jarlib-manifest 
 destfile=../../generated-manifest.txt 
 extension-name=org.realityforge.dve 
 specification-version=1.0 
 specification-vendor=Peter Donald  
 attribute name=Main-class 
value=org.realityforg.dve.WorldGen/ 
 depends dir=../../ 
 include name=src/ant1compat/jar/*.jar/ 
 /depends 
 depends dir=../../ 
 include name=lib/*.jar/ 
 /depends 
 /jarlib-manifest 
 
 This would generate a manifest with the specified extension, an extra 
 attribute Main-class in the main section and all the dependency info. A 
 sample output may be
 
 Manifest-Version: 1.0 
 Created-By: Myrmidon @@VERSION@@ compiled on @@DATE@@ 
 Extension-Name: org.realityforge.dve 
 Specification-Version: 1.0 
 Specification-Vendor: Peter Donald 
 Main-class: org.realityforg.dve.WorldGen 
 Extension-List: lib0 lib1 
 lib0-Extension-Name: org.apache.tools.ant 
 lib0-Specification-Version: 1.4.9 
 lib0-Specification-Vendor: Apache Software Foundation 
 lib1-Extension-Name: org.apache.tools.ant.taskdefs.optional 
 lib1-Specification-Vendor: Apache Software Foundation 
 lib1-Specification-Version: 1.4.9 
 
 Notice that by default you don't include the implementation details in the 
 dependencies generated (at least not by default). To turn on dependency on a 
 specific implementation of a library you could specify the attribute 
 includeImpl=true and it would generate
 
 Manifest-Version: 1.0 
 Created-By: Myrmidon @@VERSION@@ compiled on @@DATE@@ 
 Extension-Name: org.realityforge.dve 
 Specification-Version: 1.0

Re: httpclient timeout

2001-12-01 Thread Fredrik Lindgren

+1 for adding timeouts

Currently HttpClient does not seem to have a way to set the timeout. 
(I'm just a user and I might be wrong)

However it should be easy to implement since the HttpConnection uses 
Java.net.Socket inside.

The following snippet should do the trick if added to HttpConnection

/**
  * Set my {@link Socket}'s timeout, via
  * {@link Socket#setSoTimeout}.
  * @throws SocketException - if there is an error in the underlying
  * protocol, such as a TCP error.
  * @throws IllegalStateException if I am not connected
  */
public void setSoTimeout(int timeout)
throws SocketException, IllegalStateException {
log.debug(HttpConnection.setSoTimeout());
assertOpen();
_socket.setSoTimeout(int timeout);
} 


Please correct me if I'm wrong, or respond with a good argument why this 
would be a bad way to do it.

An alternative to changing the public API would be to add a protected 
method getSocket() so that extending HttpConnection to support timeouts 
would be possible.

/Fredrik Lindgren   


[EMAIL PROTECTED] wrote:

 Hello,
 
 I would imagine that this is a very frequently asked question, but I could not find 
any mention of it in the list archives.
 
 Does Commons' httpclient have a way of setting a connection timeout?
 I looked at the API javadocs and could not find a way to do it.
 
 If there is no way to do it does httpclient block when it encounters super slow 
connections?
 
 Thanks,
 Otis
 
 _
 iVillage.com: Solutions for Your Life 
 Check out the most exciting women's community on the Web   
 http://www.ivillage.com
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]