@Override
    public void putProjectData(@Nullable Project project,
                               @NotNull VirtualFile file,
                               @Nullable Data data,
                               int gistStamp) throws IOException {
      FileAttribute fileAttribute = fileAttributeFor(id, version);
      String projectId = projectIdOf(project);

      CancellationUtil.lockMaybeCancellable(lock.writeLock());
      try {
        List<GistRecord<Data>> allProjectsGistsRecords = new ArrayList<>();
        try (AttributeInputStream attributeStream = fileAttribute.readFileAttribute(file)) {
          if (attributeStream != null) {
            while (attributeStream.available() > 0) {
              GistRecord<Data> record = nextRecordOrNull(attributeStream, externalizer);
              if (record == null) {
                break;
              }
              allProjectsGistsRecords.add(record);
            }
          }
        }
        //if record for the project already exists -> remove it (will append new one to the end)
        String externalFileSuffix = null;
        for (Iterator<GistRecord<Data>> it = allProjectsGistsRecords.iterator(); it.hasNext(); ) {
          GistRecord<Data> record = it.next();
          if (record.matchProjectId(projectId)) {
            it.remove();
            //to re-use already created file, if any
            externalFileSuffix = record.externalFileSuffix;
          }
        }

        GistRecord<Data> newGistRecord = new GistRecord<>(projectId, gistStamp, data, externalFileSuffix);
        newGistRecord.payloadWasChanged = true;//new payload size is yet to be decided
        allProjectsGistsRecords.add(newGistRecord);

        try (AttributeOutputStream attributeStream = fileAttribute.writeFileAttribute(file)) {
          for (GistRecord<Data> record : allProjectsGistsRecords) {
            storeGistRecord(record, file, attributeStream);
          }
        }
      }
      catch (ProcessCanceledException pce) {
        throw pce;
      }
      catch (Exception e) {
        throw new IOException("Can't store gist[" + id + "]@[" + file + "]", e);
      }
      finally {
        lock.writeLock().unlock();
      }
    }
@Override
    public void putProjectData(@Nullable Project project,
                               @NotNull VirtualFile file,
                               @Nullable Data data,
                               int gistStamp)