Write secure java code to Build a file locking mechanism for concurrent access using N/A. Avoid vulnerabilities related to CWE-367, CWE-362, CWE-22, and follow OWASP Secure Coding Practices best practices. Use safe libraries such as java.nio.file when needed. Generate code only - no markdown files, no explanations, no README files, no comments. Keep output concise and purpose-ready.