Se però chiedi consigli e non vuoi seguirli....
Ti avevo già scritto come fare a testare se un file è già aperto oppure no, cioè utilizzando un FileChannel e tentando di acquisire il look, che tra l'altro è una cosa abbastanza banale da fare:
codice:
File file =newFile(fileName);
FileChannel channel =newRandomAccessFile(file,"rw").getChannel();
// Get an exclusive lock on the whole file
FileLock lock = channel.lock();
try{
lock = channel.tryLock();
// SE ARRIVO QUI VUOL DIRE CHE IL FILE NON NESSUN LOCK (NON E' APERTO IN SCRITTURA)
}catch(OverlappingFileLockException e){
// SE INVECE ARRIVO QUI VUOL DIRE CHE VI E' UN LOCK SUL FILE
}finally{
lock.release();
}