Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.jnape.palatable.dmutex.fs;
 
 
 import java.io.File;
    private final FileChannel fileChannel;
        this. = fileChannel;
    }
    @Override
        try {
            return new DistributedFileSystemLock(.lock());
        } catch (OverlappingFileLockException overlap) {
            throw new LockCurrentlyHeldException(overlap);
        } catch (IOException ioException) {
            throw new RuntimeException(ioException);
        }
    }
    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        .close();
    }
    public static DistributedFileSystemMonitor create(File lockFile) {
        try {
            FileChannel fileChannel = new FileOutputStream(lockFile).getChannel();
            return new DistributedFileSystemMonitor(fileChannel);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
New to GrepCode? Check out our FAQ X