Apache Commons Tutorial with Examples

Apache commons tutorial with examples will help you understand how to use the Apache commons classes more easily. Apache Commons is a collection of libraries with many useful and reusable Java Components. Apache Commons project is developed and maintained by developers of the Apache community.

Apache Commons libraries are open source and can be obtained, modified, and distributed freely (with preservation of copyright notice and disclaimer).

Apache Commons libraries provide functionality which is either missing from the core Java libraries or is difficult to implement. These libraries are properly tested which is why you should use them instead of writing your own code where ever possible.

Apache commons provide so many useful libraries, some of them are listed below.

  • DbUtils library provides various JDBC and database related functionality.
  • BeanUtils library provides easy to use wrappers around Java reflection API.
  • CLI library provides easy API for parsing the command line arguments passed into your programs.
  • The email library is very useful for sending emails using Java.
  • Codec library is an implementation of commonly used encoders and decoders.
  • FileUpload library provides upload functionality to any web application.
  • IOUtils provides input output utilities.
  • Lang library provides extra functionality to the java.lang package.
  • CollectionUtils class provides various methods to work on the Java collections.
  • Crypto is an apache cryptographic library.
  • DBCP is a database connection pool implementation based on commons pool 2 and offers better performance.
  • ArrayUtils class provides various methods for manipulating arrays.
  • JXPath library provides various utilities for manipulating java beans using XPath syntax.
  • The logging library provides a wrapper around popular logging APIs.
  • Math library provides functionality not available in Java.
  • Net library is a client side implementation of many basis internet protocols like FTP, SMTP, POP3, IMAP, etc.
  • Proxy library allows us to create dynamic proxies.
  • Commons text provides many utilities to work with text or strings.

You can download the Apache Commons libraries from Apache Commons Site.

Apache Commons Examples

CollectionUtils Examples

ArrayUtils Examples

NumberUtils Examples

RandomStringUtils Examples

StringUtils Examples

WordUtils Examples

ReverseListIterator Examples

ExceptionUtils Examples

IOUtils Examples

FileUtils Examples

FileNameUtils Examples

Please let me know if you liked the Apache Commons tutorial with examples in the comments section below.

About the author

RahimV

RahimV

My name is RahimV and I have over 16 years of experience in designing and developing Java applications. Over the years I have worked with many fortune 500 companies as an eCommerce Architect. My goal is to provide high quality but simple to understand Java tutorials and examples for free. If you like my website, follow me on Facebook and Twitter.

Add Comment

Your email address will not be published. Required fields are marked *