|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.lib.RefWriter
public abstract class RefWriter
Writes out refs to the Constants.INFO_REFS
and
Constants.PACKED_REFS
files.
This class is abstract as the writing of the files must be handled by the
caller. This is because it is used by transport classes as well.
Constructor Summary | |
---|---|
RefWriter(Collection<Ref> refs)
|
|
RefWriter(Map<String,Ref> refs)
|
|
RefWriter(RefList<Ref> refs)
|
Method Summary | |
---|---|
protected abstract void |
writeFile(String file,
byte[] content)
Handles actual writing of ref files to the git repository, which may differ slightly depending on the destination and transport. |
void |
writeInfoRefs()
Rebuild the Constants.INFO_REFS . |
void |
writePackedRefs()
Rebuild the Constants.PACKED_REFS file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RefWriter(Collection<Ref> refs)
refs
- the complete set of references. This should have been computed
by applying updates to the advertised refs already discovered.public RefWriter(Map<String,Ref> refs)
refs
- the complete set of references. This should have been computed
by applying updates to the advertised refs already discovered.public RefWriter(RefList<Ref> refs)
refs
- the complete set of references. This should have been computed
by applying updates to the advertised refs already discovered.Method Detail |
---|
public void writeInfoRefs() throws IOException
Constants.INFO_REFS
.
This method rebuilds the contents of the Constants.INFO_REFS
file
to match the passed list of references.
IOException
- writing is not supported, or attempting to write the file
failed, possibly due to permissions or remote disk full, etc.public void writePackedRefs() throws IOException
Constants.PACKED_REFS
file.
This method rebuilds the contents of the Constants.PACKED_REFS
file to match the passed list of references, including only those refs
that have a storage type of Ref.Storage.PACKED
.
IOException
- writing is not supported, or attempting to write the file
failed, possibly due to permissions or remote disk full, etc.protected abstract void writeFile(String file, byte[] content) throws IOException
file
- path to ref file.content
- byte content of file to be written.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |