How to sleep a thread in Java
How to sleep a thread in Java using Thread.sleep() method. Comparison between sleep millis an nanos.
How to get free disk space in Java
How to get free disk space in Java using File.getFreeSpace()
, File.getTotalSpace()
and File.getUsableSpace()
.
How to convert byte size into human readable format in java
How to convert byte sizes into human readable format using Java. Convert from Kilobyte to Yottabyte.
How to create Generic Object Pool in Java
In a application you can have resources that are limited or time consuming to create a new one. e.g. a connection to a database, a new thread. A solution is to create a the limited resource once and reuse it. To address this problem the object pool pattern was introduced. The object pool design will have the mechanism to create a new object to keep the objects and to destroy the objects if necessary.
How to add delay in SoapUI Response
When you need to add a delay on your mock service response to simulate a long process or a timeout, you can easily do this by following the steps below.