Archives: Java

Java Utility – Rename Files in Folder

November 1, 2019 | By kiranbadi1991 | Comments Off on Java Utility – Rename Files in Folder | Filed in: Development, Others.

import java.io.File; import java.io.IOException; public class FileRename { public static void main(String args[]) throws IOException { String DIR_PATH = "MyDirectoryPath"; String stringToReplace = "MyStringtoReplaceInFileName"; getFileNames(DIR_PATH, stringToReplace); } public static void getFileNames(String Path, String stringToReplace) throws IOException { File folder = new File(Path); File[] listOfFiles = folder.listFiles(); System.out.println("Total Files :" + listOfFiles.length); for (int i = • Read More »

Tags:

Concurrency, Thread Safety and Local Variables

August 12, 2016 | By kiranbadi1991 | Comments Off on Concurrency, Thread Safety and Local Variables | Filed in: Development, Performance Center, Performance Engineering, Performance Test Tools.

One of the most of the common reason for concurrency issues I often see in web application is due to concurrent access of data stored in variables. Generally in servlets , data in variables are often stored as Local variables, Instance Variables, Class Variables , request attributes, session attributes and context attributes. Below example simplest • Read More »

Tags: , ,

Oops Error and Java Error/Exception Handling

April 4, 2014 | By kiranbadi1991 | Comments Off on Oops Error and Java Error/Exception Handling | Filed in: Development, Environment, Performance Engineering, Project Management, Web Server.

Very Often during the testing for java based application, I come across the generic Oops error message which looks something like below screenshot, Lot many developers who are building the java based application  or are new to development use these techniques to display error or exception message. It’s a good technique and even I have • Read More »

Tags: , ,