Convert String InputStream Java In below sample java program we will convert String to InputStream. I will show you two way to convert. In first example we will use ByteArrayInputStream and second example will use Apache commons (Preferred approach):

Check Directory Empty Java If you want to search directory and check if it is empty or not using java please have sample program below. We will use jdk 7 Files.newDirectoryStream open directory and use iterator to check if it … Continue reading →

Delete Directory Java Below is sample java program which will delete directory. Please be aware until you empty all content of the directory you can not delete it so for this we will use method recursion to empty directory and … Continue reading →