Home » Core Java » apache » commons » Page 2

commons

org.apache.commons.dbcp2.PoolableConnection Example

In this post we learn how to use a connection’s pool using the apache commons dbcp2 framework. A connection pool is an object that maintains a pool of opened connections so the application can simply grab one when it needs to, use it, and then hand it back, eliminating much of the long wait of the creation of connections. 1. ...

Read More »

org.apache.commons.beanutils.converters.ArrayConverter Example

This article introduces the ArrayConverter class of the org.apache.commons.beanutils.converters package and its basic usage. This is defined in the Apache Commons BeanUtils 1.9.2 API. ArrayConverter is generic Converter implementation that handles conversion to and from array objects. The main features of this implementation are to convert: Individual elements of an array by delegating to a converter of appropriate type. From ...

Read More »

org.apache.commons.cli.BasicParser Example

Basic Parser is for Command Line Processing. Command Line Processing has three stages definition, parsing and interrogation. Options are defined for command line processing. Command Line interface uses the options class as a container for option instances. To create options, there are two ways. The constructors and factory methods defined in options are the two methods of creating optios. Definition ...

Read More »

org.apache.commons.io.comparator.DirectoryFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. DirectoryFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by directories and files. The File class’s isDirectory() method is used for comparing two files. This article shows ...

Read More »

org.apache.commons.io.comparator.LastModifiedFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. LastModifiedFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their last modified date/time. The File class’s lastModified() method is used for comparing two files; the method ...

Read More »

org.apache.commons.lang3.math.Fraction Example

Hi folks, Today we are going to talk about Fractions from org.apache.commons.lang3.math package. This api provides us with capabilities to handle operations on fractions. I wrote a nice and simple java program demonstrating the application of this api. If you are already a java programmer and if you have tried dividing two numbers with different datatypes, you would have encountered ...

Read More »

org.apache.commons.io.comparator.NameFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. NameFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their name. The File class’s getName() method is used for comparing two files; the method returns the ...

Read More »

org.apache.commons.lang3.ClassPathUtils Example

In this example we are going to elaborate the use of the ClassPathUtils class in the package: org.apache.commons.lang3 or previouslyorg.apache.commons.lang, as the package name says, it is a member of the Apache Commons Lang, and deals with the classpaths. As like other classes of the Apache Commons This class also provides us with some really helpful methods. The methods of this ...

Read More »

org.apache.commons.lang3.CharUtils Example

In this example we are going to elaborate the use of the CharUtils class in the package: org.apache.commons.lang3 or previously org.apache.commons.lang, as the package name says, it is a member of the Apache Commons Lang, and deals with Character (char) Manipulation. As like other classes of the Apache Commons This class also provides us with some really helpful methods. The ...

Read More »

org.apache.commons.lang3.math.NumberUtils Example

Hey folks, this post is about a Math Package:NumberUtils.It has few handful of utility methods. All methods are static, so you don’t have to create an instance of it.  It resides in org.apache.commons.lang3.math.NumberUtils package. You can download the jar from http://commons.apache.org/proper/commons-lang/.               Or using Maven <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.3.2</version> and an import is necessary import ...

Read More »