com_baeldung_lock_FileLocksUnitTest_java
com.baeldung.lock.FileLocks
*/     static void getExclusiveLockFromInputStream() throws IOException {         Path path = Files.createTempFile("foo", "txt");         try (FileInputStream fis = new FileInputStream(path.toFile());             FileLock lock = fis.getChannel()                 .lock()) {             LOG.debug("This won't happen");         } catch (NonWritableChannelException e) {             LOG.error("The channel obtained through a FileInputStream isn't writable. You can't obtain an exclusive lock on it!");             throw e;

 -> java.nio.file.Files.createTempFile(java.lang.String,java.lang.String,java.nio.file.attribute.FileAttribute[]): java.nio.file.Path -> java.nio.file.Path.toFile(): java.io.File -> java.io.FileInputStream.getChannel(): java.nio.channels.FileChannel -> java.nio.channels.FileChannel.lock(): java.nio.channels.FileLock -> java.io.FileInputStream.close(): void -> java.util.concurrent.atomic.AtomicBoolean.get(): boolean -> java.lang.ThreadLocal.get(): java.lang.Object -> java.lang.Boolean.equals(java.lang.Object): boolean -> java.lang.ThreadLocal.set(java.lang.Object): void -> java.util.concurrent.atomic.AtomicBoolean.get(): boolean -> java.text.SimpleDateFormat.format(java.util.Date): java.lang.String -> java.lang.String.getBytes(): byte[] -> java.util.concurrent.locks.ReentrantLock.lock(): void -> java.io.OutputStream.write(byte[]): void -> java.io.PrintStream.write(byte[]): void -> java.io.OutputStream.flush(): void -> java.io.PrintStream.flush(): void -> java.util.concurrent.locks.ReentrantLock.unlock(): void -> java.lang.ThreadLocal.set(java.lang.Object): void