Possible Duplicate:
Java: Check if file is already open
I am making a swing utility in which i am creating and using a excel sheet by Apache poi. If the file is already opened while i m trying to access it it throws an exception like some other process is using this excel file. So all i want is to check if that excel file is already opened and if yes then close it.