tomcat-dbcp vs commons-dbcp

Tomcat DBCP is just a renamed version of Apache Commons DBCP, with also a different internal package name prefix. At build time, Tomcat fetches the Commons DBCP sources (the version depends on the Tomcat version, for instance Tomcat 7.0.27 uses Commons DBCP 1.4), and does package name replacement (org.apache.commons -> org.apache.tomcat.dbcp) and builds the result … Read more

Apache Commons Net FTPClient and listFiles()

Found it! The thing is you want to enter passive mode after you connect, but before you log in. Your code returns nothing for me, but this works for me: import org.apache.commons.net.ftp.FTPClient; import java.io.IOException; import org.apache.commons.net.ftp.FTPFile; public class BasicFTP { public static void main(String[] args) throws IOException { FTPClient client = new FTPClient(); client.connect(“c64.rulez.org”); client.enterLocalPassiveMode(); … Read more

Map that could be iterated in the order of values

I would do this with Guava as follows: Ordering<Map.Entry<Key, Value>> entryOrdering = Ordering.from(valueComparator) .onResultOf(new Function<Entry<Key, Value>, Value>() { public Value apply(Entry<Key, Value> entry) { return entry.getValue(); } }).reverse(); // Desired entries in desired order. Put them in an ImmutableMap in this order. ImmutableMap.Builder<Key, Value> builder = ImmutableMap.builder(); for (Entry<Key, Value> entry : entryOrdering.sortedCopy(map.entrySet())) { builder.put(entry.getKey(), … Read more

SpringBoot: Large Streaming File Upload Using Apache Commons FileUpload

Thanks to some very helpful comments by M.Deinum, I managed to solve the problem. I have cleaned up some of my original post and am posting this as a complete answer for future reference. The first mistake I was making was not disabling the default MultipartResolver that Spring provides. This ended up in the resolver … Read more