code: private void ensureIndexIsUnlocked(String dataDir) {
  
          Collection<File> lockFiles = new ArrayList<File>(2);
          lockFiles.add(
              new File(
                  CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "index") + "write.lock"));
          lockFiles.add(
              new File(
                  CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "spellcheck")
                      + "write.lock"));
          for (File lockFile : lockFiles) {
              if (lockFile.exists()) {
                  lockFile.delete();
                  LOG.warn(
                      "Forcely unlocking index with data dir \""
                          + dataDir
                          + "\" by removing file \""
                          + lockFile.getAbsolutePath()
                          + "\".");
              }
          }
      }
docs: Remove write.lock file in the data directory to ensure the index is unlocked.
  @param dataDir the data directory of the Solr index that should be unlocked.