code: public boolean checkAccess(String path, boolean readOnly) {
          final FileServiceMXBean fileService = getFileService();
          if (readOnly) {
              //we can read from both the read and write list
              return (FileServiceUtil.isPathContained(fileService.getReadList(), path) || FileServiceUtil.isPathContained(fileService.getWriteList(), path));
          } else {
              //we can write only to the write list
              return FileServiceUtil.isPathContained(fileService.getWriteList(), path);
          }
      }
docs: Check if the specified path is open for read/write access