Code example for FileLock

Methods: release

0
                        // be called. If it does, we will close the output 
                        // stream, which will in turn close the channel. 
                        // We will then release the lock. 
                        try { 
                            tmpOut.close();
                            tmpLock.release();
                            lckOut.close();
                            lckLock.release();
                        } catch (IOException ex) {
                            // Do nothing 
                        } 
                    } 
                }); 
 
                // Set the system property... 
                tmpRootPropValue = tmpRootName.substring(tmpRootName.lastIndexOf(File.separator) + 1);
                System.setProperty(tmpRootPropName, tmpRootPropValue);
                if (DEBUG) {
                    System.err.println("TempFileCache: Setting " + tmpRootPropName + "=" + tmpRootPropValue);
                } 
Experience pair programming with AI  Get Codota for Java