How to detect file type from content in Java
This tutorial shows how to detect file type from content in Java using Apache Tika. File format detection is a usually required in search engines where crawled resources are required to be analysed, classified, tagged and indexed. We will use Apache’s Tika here to do the job.
Reading Property File in Java using Apache Commons Configuration
This tutorial demonstrates reading property file in Java using Apache Commons Configuration library. You may have different configuration sources such as property files, XML files, system properties, environment variables etc. Apache Commons Configuration allows you to collect properties from many such sources and access them as a single configuration object. It also allows you to set the order […]
Understanding Custom ThreadFactory In Java
A thread factory encapsulates the logic of creation and configuration of threads. It creates and returns thread instances on demand. You can see it being used in the JDK’s executor framework. Every thread pool has an associated thread factory that creates the threads for the pool. The thread factory not just creates thread instances but also […]