Does Apache Commons HttpClient support GZIP?
Apache HttpClient 4.1 supports content compression out of the box along with many other features that were previously considered out of scope.
Apache HttpClient 4.1 supports content compression out of the box along with many other features that were previously considered out of scope.
Any reason why Apache BeanUtils.copyProperties does not work?
Use the following method: CommandLine.getArgList() which returns whatever’s left after options have been processed.
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
In Java 8 you can use String.join() like following: Collection<String> elements = ….; String result = String.join(“, “, elements);
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
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
You can use the Google Collections API for that, recently renamed to Guava, specifically a BiMap A bimap (or “bidirectional map”) is a map that preserves the uniqueness of its values as well as that of its keys. This constraint enables bimaps to support an “inverse view”, which is another bimap containing the same entries … Read more
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