Multipart file upload client: File upload client is capable of uploading different kind of files using apache httpclient. File upload client will upload files to RESTFul web service, exposing multipart resource. What is objective of File Upload client? File upload client will use “multipart/mixed” mime type. We have demonstrated the following file formats to be uploaded… Read More »
Given the code or functional block of program , we would like to find elapsed time, to execute the code block. We can find the execution time in milliseconds. We can also find the execution time in nano seconds (if we need more precision). Note down current clock time (milliseconds or nanoseconds) Mark it as… Read More »
Given a the list of objects, we need to sort the objects by their multiple properties. We have used java 8 streams to sort the objects. In below example, we have take the Person object. We will sort the list of person objects by their firstName. Also we have shown the cascaded sorting wherein we have sorted the list on multiple fields.We have performed the following operations.
Given the strings of array containing nulls and empty string. We will be using Java 8 streams to filter out null and empty string in strings of array. Let us take a complete example to filter out null and empty string
Suppose we are given the List collection containing the String values, we will remove the null values from list collections using filter of Java 8. Let us take a look into the below example
Generally in our application we need to convert one object into another type. We can not directly transform one object to another. In traditional way we need to iterate source object and convert to destination object. We will be using Java 8 lamdas to translate one object into another.
In this post, we will discuss Jersey (RESTFul Service) Exception mapper example for user defined or custom exceptions. We have already discussed, usage of standard exceptions in Example of ExceptionMapper – RESTFul web Service. We will create couple of user defined exceptions MyNullPointerException (extending NullPointerException). MyArithmeticException (extending ArithmeticException). We will define following exceptionmappers to catch application & user defined exceptions. ApplicationExceptionMapper… Read More »