talira

Apache Commons

Reusable Java components

open sourceApache-2.0free

Apache Commons is the Apache Software Foundation's project for reusable Java components, each a small library with few dependencies and its own releases. The most used are Lang (extra functionality for java.lang), IO, Codec (base64, phonetic and URL encoding), Collections, Text (string algorithms), CLI (command-line argument parsing), Compress (tar, zip, bzip2 and more), CSV, Configuration, DBCP (database connection pooling), Pool, BeanUtils, Logging, Validator, VFS and Math. Components no longer developed are kept in the Commons Dormant.

Problems it solves

  • Java's standard library is missing basic string, array and object helpers I keep rewriting
  • copy streams, read files to strings and delete directories in Java without boilerplate
  • encode and decode base64, hex and URL strings in Java
  • parse command-line arguments in a Java program
  • read and write CSV files in Java
  • pool database connections in a Java app
  • read tar, zip, 7z and bzip2 archives from Java code
  • load configuration from properties, XML and other formats in Java
  • treat local files, FTP, SFTP and zip files as one file system from Java
  • string similarity, escaping and substitution algorithms for Java
  • a generic object pool for expensive objects in Java
  • validate emails, URLs and other input in a Java application

Features

  • Lang: helpers for strings, arrays, objects, reflection and more beyond java.lang
  • IO: I/O utilities for streams, files and directories
  • Codec: base64, hex, phonetic and URL encoders and decoders
  • Collections: extensions to the Java Collections Framework
  • Text: string algorithms
  • CLI: command-line argument parser
  • Compress: tar, zip and bzip2 archives
  • CSV: reading and writing CSV
  • Configuration: configuration files in several formats
  • DBCP and Pool: database connection pooling and generic object pooling
View 2 more
  • VFS: one API over local files, FTP, SMB, ZIP and more
  • Validator, BeanUtils, Exec, Email, Net, Math, RNG, Statistics and more components, each released on its own

Alternatives

The same job

These do what Apache Commons does.

  1. Guava Google core libraries for Java

Compare Apache Commons with the top 3