org.eclipse.jgit.lib
Class ObjectInserter.Formatter

java.lang.Object
  extended by org.eclipse.jgit.lib.ObjectInserter
      extended by org.eclipse.jgit.lib.ObjectInserter.Formatter
Enclosing class:
ObjectInserter

public static class ObjectInserter.Formatter
extends ObjectInserter

An inserter that can be used for formatting and id generation only.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.ObjectInserter
ObjectInserter.Formatter
 
Constructor Summary
ObjectInserter.Formatter()
           
 
Method Summary
 void flush()
          Make all inserted objects visible.
 ObjectId insert(int objectType, long length, InputStream in)
          Insert a single object into the store, returning its unique name.
 PackParser newPackParser(InputStream in)
          Initialize a parser to read from a pack formatted stream.
 void release()
          Release any resources used by this inserter.
 
Methods inherited from class org.eclipse.jgit.lib.ObjectInserter
buffer, digest, idFor, idFor, idFor, idFor, insert, insert, insert, insert, insert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectInserter.Formatter

public ObjectInserter.Formatter()
Method Detail

insert

public ObjectId insert(int objectType,
                       long length,
                       InputStream in)
                throws IOException
Description copied from class: ObjectInserter
Insert a single object into the store, returning its unique name.

Specified by:
insert in class ObjectInserter
Parameters:
objectType - type code of the object to store.
length - number of bytes to copy from in.
in - stream providing the object content. The caller is responsible for closing the stream.
Returns:
the name of the object.
Throws:
IOException - the object could not be stored, or the source stream could not be read.

newPackParser

public PackParser newPackParser(InputStream in)
                         throws IOException
Description copied from class: ObjectInserter
Initialize a parser to read from a pack formatted stream.

Specified by:
newPackParser in class ObjectInserter
Parameters:
in - the input stream. The stream is not closed by the parser, and must instead be closed by the caller once parsing is complete.
Returns:
the pack parser.
Throws:
IOException - the parser instance, which can be configured and then used to parse objects into the ObjectDatabase.

flush

public void flush()
           throws IOException
Description copied from class: ObjectInserter
Make all inserted objects visible.

The flush may take some period of time to make the objects available to other threads.

Specified by:
flush in class ObjectInserter
Throws:
IOException - the flush could not be completed; objects inserted thus far are in an indeterminate state.

release

public void release()
Description copied from class: ObjectInserter
Release any resources used by this inserter.

An inserter that has been released can be used again, but may need to be released after the subsequent usage.

Specified by:
release in class ObjectInserter


Copyright © 2012. All Rights Reserved.