public void writeCollectionState(URI backupLoc,String backupId,String collectionName,DocCollection collectionState) throws IOException {
  URI dest=repository.resolve(backupLoc,backupId,ZK_STATE_DIR,COLLECTION_PROPS_FILE);
  try (OutputStream collectionStateOs=repository.createOutput(dest)){
    collectionStateOs.write(Utils.toJSON(Collections.singletonMap(collectionName,collectionState)));
  }
 }

public void writeCollectionState ( URI backupLoc , String backupId , String collectionName , DocCollection collectionState ) throws IOException { URI dest = repository . resolve ( backupLoc , backupId , ZK_STATE_DIR , COLLECTION_PROPS_FILE ) ; try ( OutputStream collectionStateOs = repository . createOutput ( dest ) ) { collectionStateOs . write ( Utils . toJSON ( Collections . singletonMap ( collectionName , collectionState ) ) ) ; } }
this method writes the collection meta - data to the specified location in the repository .
