Categories
Java

HttpClient Java Get Example with Query String and Custom Headers

Apache HttpClient java library is my most preferred HttpClient library for making HTTP requests. One can easily add parameters, body, and custom headers with clean interfaces. Since version 4.0 it also provides EntityUtils to read the response from HttpResponse into string and byte arrays. Here is a complete example to make get requests with parameres […]

Categories
Java

Connection Timeout In Java HTTPClient, RestTemplate and URLConnection

Connection timeout is the time for which an HTTP client or Socket client waits, if the server doesn’t respond in that time or not found then the client closes the connection. HTTP also uses sockets internally. Connection timeout is different from the Connection Request timeout or connection read timeout. In many situations, the client doesn’t […]

Categories
Java

Best Libraries for Working with CSV in Java

Reading and writing CSV in Java can be very simple by the use of some well known and stable CSV library. One can write CSV using core java classes very easily for reading CSV can be problematic as there are many variations in CSV. CSV is one of the most common data formats for exporting […]

Categories
Article

Office Lens PDF Scanner Mobile App for Online Classes

Office Lens is free to use the Mobile app for Android and Ios devices. Which is very handy in scanning documents, whiteboards, pictures, and cards. This can be download from Microsoft Office Lens – PDF Scanner Play Store and Microsoft Office Lens|PDF Scan Apple store. Microsoft is known for its user-friendly products, Nowadays most of […]

Categories
Java

SpotBugs Static Analysis Tool For Java Developers

SpotBugs is a software tool for static analysis of Java programs, which is free to download, use,  open-source and can be used in various ways. It can be installed as Eclipse Plugin, configured with Maven build as plugin and Gradle builds as a plugin. It is very handy while being used as an Eclipse plugin […]

Categories
Java

Best Way to Keep Java Code Clean and Organized Using Eclipse

Eclipse IDE Java Editor Save Actions option should be used by all developers as it helps to keep code clean and organized. Eclipse is the most widely used IDE for Java programming as it provides a lot of features and it has the support of many free and paid plugins. Most important it is free […]

Categories
Java

Merge Two list in Java in Efficient Way

While doing development many times we need to merge two or more collections in Java. Sometimes we need simple concatenate two or more lists or sets or merge two or more lists by removing duplicates and sometimes we need to do this is sorted order. Here is one example to merge two lists, this can […]

Categories
Java

Best way to remove duplicate items from ArrayList in Java

Removing duplicate items from ArrayList in Java can be done in some very efficient ways using Java 8 or Guava lib for Java. Guava lib provides many efficient util classes to perform different operations on collections like creating, sorting, reversing, partitioning, etc. Removing duplicate using Guava API Here is the most efficient way to remove […]

Categories
Java

Create, Partition and Reverse Array List Using Guava Lists

Guava Lists is part of the Guava core java library. It is used to perform many frequently used operations on an array lists like creation, partition, reversal, and many more. Java Guava lib is collection of very safe and handy libs for working with collection types (such as list, multimap, bimap, and multiset), immutable collections, […]

Categories
Java

Quickest way to append text to a file in Java

In Java, there are several different ways to append text in a file. For file operations, Java provides several classes. To appending text quickly you can use Files class. Append text to file example: try { Files.write(Paths.get(“file1.txt”), “text to append”.getBytes(), StandardOpenOption.APPEND); } catch (IOException e) { // To exception handling here } But above method […]