private void readPropertiesNoAwait()

in agent/src/jetbrains/buildServer/swabra/SwabraPropertiesProcessor.java [124:160]


  private void readPropertiesNoAwait(boolean preserveFile) {
    if (!myPropertiesFile.isFile()) {
      myLogger.debug("Couldn't read directories states from " + myPropertiesFile.getAbsolutePath() + ", no file present");
      return;
    }
    BufferedReader reader = null;
    try {
      reader = new BufferedReader(new FileReader(myPropertiesFile));
      String fileRecord = reader.readLine();
      while (fileRecord != null) {
        final String[] mapElem = fileRecord.split(KEY_VAL_SEPARATOR);
        if (mapElem.length > 4 || mapElem.length < 2) {
          myLogger.warn("Error reading directories states from " + myPropertiesFile.getAbsolutePath() + ", came across illegal record");
          return;
        }
        final String dir = mapElem[0];
        final String checkoutDir = mapElem.length == 2 ? dir : mapElem[2];
        myProperties.put(dir, new DirInfo(mapElem[1], checkoutDir, mapElem.length == 4 ? mapElem[3] : null));
        fileRecord = reader.readLine();
      }
    } catch (IOException e) {
      myLogger.warn("Error reading directories states from " + myPropertiesFile.getAbsolutePath() + getMessage(e));
      myLogger.exception(e);
    } finally {
      if (reader != null) {
        try {
          reader.close();
        } catch (IOException e) {
          myLogger.warn("Error closing directories states file " + myPropertiesFile.getAbsolutePath() + getMessage(e));
          myLogger.exception(e);
        }
      }
      if (!preserveFile) {
        deletePropertiesFile();
      }
    }
  }