List of usage examples for org.eclipse.jgit.internal.storage.dfs DfsPackDescription setFileSize
public DfsPackDescription setFileSize(PackExt ext, long bytes)
From source file:com.benhumphreys.jgitcassandra.store.DescMapper.java
License:Apache License
/** * Given a map of extension/size, add each to the pack description. * * @param desc pack description to mutate * @param extsize a map from extension string to file size *///from ww w. jav a 2s . c om public static void setFileSizeMap(DfsPackDescription desc, Map<String, Long> extsize) { for (Map.Entry<String, Long> entry : extsize.entrySet()) { desc.setFileSize(lookupExt(entry.getKey()), entry.getValue()); } }
From source file:org.chodavarapu.jgitaws.repositories.PackDescriptionRepository.java
License:Eclipse Distribution License
private static DfsPackDescription fromJson(String json, DfsPackDescription desc) { JSONObject object = new JSONObject(json); desc.setPackSource(object.optEnum(DfsObjDatabase.PackSource.class, "source")) .setLastModified(object.optLong("modified")).setObjectCount(object.optLong("objects")) .setDeltaCount(object.optLong("deltas")).setIndexVersion(object.optInt("ixVersion")) .clearPackStats();/*from ww w . j av a 2 s . c o m*/ for (PackExt ext : PackExt.values()) { if (object.has(ext.getExtension() + "Size")) { desc.addFileExt(ext); desc.setFileSize(ext, object.getLong(ext.getExtension() + "Size")); } } return desc; }