apache-commons

Classloading conflicts with apache commons classes for app deployed to WAS 6.1

I have an app that uses apache-commons-collections v3.2.1. When I deploy the war file using the WAS 6.1 Integrated Solutions Console I get errors because the commons-collections.jar file in isclite.ear gets loaded before the one that I bundle with my .war file. The problem is that my application requires v3.0.0+ of commons collections. T...

Any java APIs to sort list of objects based on passed object's field name?

I have a list of objects and I want to sort by passing object's field name and order(ascending or descending). For example: my object is, class Person{ private String name; private String age; //getters and setters .......... } I will pass (List personList , String "name" and boolean isAscending) to...

Is StringUtils.isNumeric() method specification logically correct?

Apache's StringUtils.isNumeric() method specification says: Checks if the String contains only unicode digits. A decimal point is not a unicode digit and returns false. Null will return false. An empty String ("") will return true. Is this logically right? Why do they see empty string as numeric? ...

Connecting to a SOCKS5 proxy to do FTP/S in Java

I'm writing a job that will connect to a client's FTP/S server over my SOCKS5 proxy and I'm utilizing the Apache Commons Net package. The issue is that my SOCKS proxy is configured to not require authentication but I am still getting the following exception: java.net.SocketException: SOCKS : authentication failed at java.net.SocksSo...

HTML entity decoding in Java: apostrophe

I have to decode, using Java, HTML strings which contain the following entities: "&#39" and "&apos". I'm using Apache Commons Lang, but it doesn't decode those two entities, so, I'm currently doing as follows, but I'm looking for the fastest way to do what I want. import org.apache.commons.lang.StringEscapeUtils; public class StringUti...

Create Java-Zip-Archive from existing OutputStream

Is it possible to create a Zip-Archive in Java if I do not want to write the resulting archive to disk but send it somewhere else? The idea is that it might be a waste to create a file on disk when you want to send the Zip-Archive to a user via HTTP (e.g. from a Database-Blob or any other Data-Store). I would like to create a java.ut...

Apache Commons ZipArchiveOutputStream breaks upon adding Filenames with non ASCII Chars

I am using an org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream to add files coming from a Subversion repository. This works fine as long as I do not use German Umlauts (ä,ö,ü) or any other special characters in the filename. I am wondering what would be the fastest way to make it accept non ASCII chars? def zip(repo: SVN...