Browsed by
Tag: java

Secure Jersey 2 Hello World Example

Secure Jersey 2 Hello World Example

Jersey is very popular framework to build restful services. In this tutorial, we will learn how to do HTTP basic authentication, so that user won’t be able to access any resource untill they provided the correct username and passowrd. This example has been extended from our previous simple Jersy 2 Hello World tutorial. Please refer the previous tutorial for technology used and basic configurations.

Read More Read More

Read a file in java

Read a file in java

Java IO package contains classes which programmers are used to read content of a file . However, there are different ways to read content of a file and thus create dilemma to select one method over other. To select a efficient way, one should first consider nature of input file, content whether small or large and so on. In this blog, we have come up with different ways to read a file in Java with example.

Read More Read More

BufferedReader vs Scanner

BufferedReader vs Scanner

There are different classes available in java to read content of a file. Most commonly and easiest way to read a file is using BufferedReader however in certain situation it is good to use Scanner class. You can find different ways to read content of a file in our blog read a file in java. Here, we are discussing the difference between BufferedReader and Scanner classes which are listed below, helps programmers to decide between BufferedReader and Scanner class.

Read More Read More