code: protected void createLockFile(String pid, String label) throws IOException {
          if (!AccessHelper.isDirectory(repositoryLocation)) {
              AccessHelper.makeDirectories(repositoryLocation);
          }
  
          // Remove stale lock files if any.
          for (File lock : listFiles(LOCKFILE_FILTER)) {
              AccessHelper.deleteFile(lock);
          }
  
          // Create a new lock file.
          StringBuilder sb = new StringBuilder();
          sb.append(getLogDirectoryName(System.currentTimeMillis(), pid, label)).append(LOCK_EXT);
          AccessHelper.createFileOutputStream(new File(repositoryLocation, sb.toString()), false).close();
      }
docs: Creates lock file to be used as a pattern for instance repository.
  Should be called only by parent's manager on start up.
  
  @param pid process ID of the parent.
  @param label label of the parent.
  @throws IOException if there's a problem to create lock file.