-
lang3
Date and Time format
With this example we are going to demonstrate how to make Date and Time formatting. We are using the org.apache.commons.lang3.time.DateFormatUtils…
Read More » -
lang3
Convert array to Map
In this example we shall show you how to convert an array to a Map. We are using the org.apache.commons.lang3.ArrayUtils class,…
Read More » -
lang3
Array of Objects to Array of primitives
This is an example of how to convert an array of Objects to an array of primitives. We are using the…
Read More » -
lang3
Find elements in an array
With this example we are going to demonstrate how to find elements in an array. We are using the org.apache.commons.lang3.ArrayUtils…
Read More » -
codec
Encode Base64
In this example we shall show you how to encode Strings with the Base64 algorithm. We are using the org.apache.commons.codec.binary.Base64 class…
Read More » -
io
Get Disk Free Space
This is an example of how to get the Disk free space in Java. We are using the org.apache.commons.io.FileSystemUtils class that…
Read More » -
io
Create a copy of a file
With this example we are going to demonstrate how to create a copy of a file. We will make use…
Read More » -
io
Set content to a file
In this example we shall show you how to set the content to a File. We will make use of…
Read More » -
io
touch file using apache commons io example
This is an example of how to touch a file. We will make use of the org.apache.commons.io.FileUtils class, that provides…
Read More » -
lucene
Create Lucene Index
package com.javacodegeeks.lucene; import java.io.File; import java.io.FileReader; import java.io.IOException; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.store.FSDirectory; public class…
Read More »