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 […]
Adding custom headers to Java HttpServletRequest
The javax.servlet.http.HttpServletRequest is an interface that does not have setter methods except for setCharacterEncoding() and setAttribute() methods that it inherits from its parent javax.servlet.ServletRequest interface. Otherwise, the HttpServletRequest type objects are read only.