@Override public void close() { delegate().close(); } }
/** {@inheritDoc} */ @Override public void close() { inserter.close(); reader.close(); for (RemotePack p : unfetchedPacks) { if (p.tmpIdx != null) p.tmpIdx.delete(); } for (WalkRemoteObjectDatabase r : remotes) r.close(); }
/** * Set the inserter this merger will use to create objects. * <p> * If an inserter was already set on this instance (such as by a prior set, * or a prior call to {@link #getObjectInserter()}), the prior inserter as * well as the in-progress walk will be released. * * @param oi * the inserter instance to use. Must be associated with the * repository instance returned by {@link #getRepository()} (if a * repository was provided). Will be closed at the conclusion of * {@code merge}, unless {@code flush} is false. */ public void setObjectInserter(ObjectInserter oi) { walk.close(); reader.close(); inserter.close(); inserter = oi; reader = oi.newReader(); walk = new RevWalk(reader); }
/** * Performs the merge. * * @param base * base version of the note tree * @param ours * ours version of the note tree * @param theirs * theirs version of the note tree * @return merge result as a new NoteMap * @throws java.io.IOException */ public NoteMap merge(NoteMap base, NoteMap ours, NoteMap theirs) throws IOException { try { InMemoryNoteBucket mergedBucket = merge(0, base.getRoot(), ours.getRoot(), theirs.getRoot()); inserter.flush(); return NoteMap.newMap(mergedBucket, reader); } finally { reader.close(); inserter.close(); } }
} finally { if (flush) inserter.close(); reader.close();
@Override public void close() { delegate().close(); } }
public void close() { delegate().close(); } }
@Override public void close() { inserter.close(); reader.close(); for (final RemotePack p : unfetchedPacks) { if (p.tmpIdx != null) p.tmpIdx.delete(); } for (final WalkRemoteObjectDatabase r : remotes) r.close(); }
/** {@inheritDoc} */ @Override public void close() { inserter.close(); reader.close(); for (RemotePack p : unfetchedPacks) { if (p.tmpIdx != null) p.tmpIdx.delete(); } for (WalkRemoteObjectDatabase r : remotes) r.close(); }
@Override public void close() { reader.close(); inserter.close(); revWalk.close(); }
@Override public synchronized void close() { if(!closed) { closed = true; reader.close(); inserter.close(); repo.close(); } }
@Override public synchronized void close() { if(!closed) { closed = true; reader.close(); inserter.close(); repo.close(); } }
private ObjectId storeBlob(GitBranchData gbd, String path, long contentLength, long propContentLength) { try { long adjustedContentLength = contentLength - propContentLength; if (propContentLength > 0) { getInputStream().skip(propContentLength); } /* * We want to replace the contents of the path file with the content * that we read from the input stream. */ ObjectInserter objectInserter = repo.newObjectInserter(); ObjectId id = objectInserter.insert(Constants.OBJ_BLOB, adjustedContentLength, new BoundedInputStream( getInputStream(), adjustedContentLength)); objectInserter.flush(); objectInserter.close(); return id; } catch (Exception e) { log.error("onNodeContentChanged failed: ", e); throw new RuntimeException("onNodeContentLength failed", e); } }
/** * Set the inserter this merger will use to create objects. * <p> * If an inserter was already set on this instance (such as by a prior set, * or a prior call to {@link #getObjectInserter()}), the prior inserter as * well as the in-progress walk will be released. * * @param oi * the inserter instance to use. Must be associated with the * repository instance returned by {@link #getRepository()}. */ public void setObjectInserter(ObjectInserter oi) { walk.close(); reader.close(); inserter.close(); inserter = oi; reader = oi.newReader(); walk = new RevWalk(reader); }
objectInserter.close();
/** * Set the inserter this merger will use to create objects. * <p> * If an inserter was already set on this instance (such as by a prior set, * or a prior call to {@link #getObjectInserter()}), the prior inserter as * well as the in-progress walk will be released. * * @param oi * the inserter instance to use. Must be associated with the * repository instance returned by {@link #getRepository()} (if a * repository was provided). Will be closed at the conclusion of * {@code merge}, unless {@code flush} is false. */ public void setObjectInserter(ObjectInserter oi) { walk.close(); reader.close(); inserter.close(); inserter = oi; reader = oi.newReader(); walk = new RevWalk(reader); }
/** * Performs the merge. * * @param base * base version of the note tree * @param ours * ours version of the note tree * @param theirs * theirs version of the note tree * @return merge result as a new NoteMap * @throws IOException */ public NoteMap merge(NoteMap base, NoteMap ours, NoteMap theirs) throws IOException { try { InMemoryNoteBucket mergedBucket = merge(0, base.getRoot(), ours.getRoot(), theirs.getRoot()); inserter.flush(); return NoteMap.newMap(mergedBucket, reader); } finally { reader.close(); inserter.close(); } }
/** * Performs the merge. * * @param base * base version of the note tree * @param ours * ours version of the note tree * @param theirs * theirs version of the note tree * @return merge result as a new NoteMap * @throws java.io.IOException */ public NoteMap merge(NoteMap base, NoteMap ours, NoteMap theirs) throws IOException { try { InMemoryNoteBucket mergedBucket = merge(0, base.getRoot(), ours.getRoot(), theirs.getRoot()); inserter.flush(); return NoteMap.newMap(mergedBucket, reader); } finally { reader.close(); inserter.close(); } }
} finally { if (flush) inserter.close(); reader.close();
} finally { if (flush) inserter.close(); reader.close();