List of usage examples for org.eclipse.jgit.internal.storage.dfs DfsPackDescription hasFileExt
public boolean hasFileExt(PackExt ext)
From source file:com.benhumphreys.jgitcassandra.store.DescMapper.java
License:Apache License
/** * Given a pack description, return a bit field representing the PackExt's * present./* w w w . ja v a 2s. com*/ * The actual mapping from PackExt to bit position is provided by the * PackExt class. * * @param desc the pack description to query for pack extensions * @return an integer with bits set for each PackExt present in the pack * description */ public static int getExtBits(DfsPackDescription desc) { int bits = 0; for (PackExt ext : PackExt.values()) { if (desc.hasFileExt(ext)) { bits |= ext.getBit(); } } return bits; }
From source file:org.chodavarapu.jgitaws.jgit.S3WithDynamoMetaDataObjDatabase.java
License:Eclipse Distribution License
@Override protected void rollbackPack(Collection<DfsPackDescription> descriptions) { if (logger.isDebugEnabled()) { if (descriptions != null) { for (DfsPackDescription desc : descriptions) { StringBuilder files = new StringBuilder(); for (PackExt ext : PackExt.values()) { if (desc.hasFileExt(ext)) { files.append(desc.getFileName(ext)); files.append(", "); }//w w w . j a va2s .com } logger.debug("Rolling back commit of pack files {}due to error", files.toString()); } } } try { configuration.getPackRepository().deletePacks(descriptions).toBlocking().last(); } catch (Exception e) { logger.debug("Error occurred while trying to rollback a pack commit operation!", e); } }
From source file:org.chodavarapu.jgitaws.repositories.PackDescriptionRepository.java
License:Eclipse Distribution License
private static String toJson(DfsPackDescription desc) { JSONObject json = new JSONObject().put("modified", desc.getLastModified()) .put("objects", desc.getObjectCount()).put("deltas", desc.getDeltaCount()) .put("ixVersion", desc.getIndexVersion()); for (PackExt ext : PackExt.values()) { if (desc.hasFileExt(ext)) { json.put(ext.getExtension() + "Size", desc.getFileSize(ext)); }/*from www . ja va 2 s. c o m*/ } if (desc.getPackSource() != null) { json.put("source", desc.getPackSource().name()); } return json.toString(); }
From source file:org.chodavarapu.jgitaws.repositories.PackRepository.java
License:Eclipse Distribution License
private List<String> getObjectNames(Collection<DfsPackDescription> packs) { List<String> objectNames = new ArrayList<>(); for (DfsPackDescription pack : packs) { for (PackExt ext : PackExt.values()) { if (pack.hasFileExt(ext)) { objectNames.add(/*from www . jav a 2 s .c om*/ objectName(pack.getRepositoryDescription().getRepositoryName(), pack.getFileName(ext))); } } } return objectNames; }