Archive for the ‘Java’ Category

Java: Get Element Type From A Typed Array

Sunday, December 21st, 2008
  System.out.println("" +  Long[].class.getComponentType() == Long.class);
  //will print "true"

Groovy: Embedding Groovy in Java

Saturday, October 4th, 2008

Embedding Groovy in Java

Java: ROME to parse, generate and publish RSS and Atom Feeds

Saturday, October 4th, 2008

Rome project page

Very good lib for parsing, generating and publishing RSS and Atom feeds.

Java: HTML Parser

Friday, October 3rd, 2008

HTML Parser

Other Java HTML Parsers

Java: HTTP Client (Apache)

Friday, October 3rd, 2008

Http Client from Apache

Features:

  • Standards based, pure Java, implementation of HTTP versions 1.0 and 1.1
  • Full implementation of all HTTP methods (GET, POST, PUT, DELETE, HEAD, OPTIONS, and TRACE) in an extensible OO framework.
  • Supports encryption with HTTPS (HTTP over SSL) protocol.
  • Granular non-standards configuration and tracking.
  • Transparent connections through HTTP proxies.
  • Tunneled HTTPS connections through HTTP proxies, via the CONNECT method.
  • Transparent connections through SOCKS proxies (version 4 & 5) using native Java socket support.
  • Authentication using Basic, Digest and the encrypting NTLM (NT Lan Manager) methods.
  • Plug-in mechanism for custom authentication methods.
  • Multi-Part form POST for uploading large files.
  • Pluggable secure sockets implementations, making it easier to use third party solutions
  • Connection management support for use in multi-threaded applications. Supports setting the maximum total connections as well as the maximum connections per host. Detects and closes stale connections.
  • Automatic Cookie handling for reading Set-Cookie: headers from the server and sending them back out in a Cookie: header when appropriate.
  • Plug-in mechanism for custom cookie policies.
  • Request output streams to avoid buffering any content body by streaming directly to the socket to the server.
  • Response input streams to efficiently read the response body by streaming directly from the socket to the server.
  • Persistent connections using KeepAlive in HTTP/1.0 and persistance in HTTP/1.1
  • Direct access to the response code and headers sent by the server.
  • The ability to set connection timeouts.
  • HttpMethods implement the Command Pattern to allow for parallel requests and efficient re-use of connections.
  • Source code is freely available under the Apache Software License.