public class GitSystem extends AbstractResinSubSystem
Modifier and Type | Field and Description |
---|---|
static int |
START_PRIORITY |
START_PRIORITY_CACHE_SERVICE, START_PRIORITY_CLASSLOADER, START_PRIORITY_CLUSTER_SERVICE, START_PRIORITY_DATABASE_SYSTEM, START_PRIORITY_DEFAULT, START_PRIORITY_ENV_SYSTEM, START_PRIORITY_NETWORK_CLUSTER, STOP_PRIORITY_CLASSLOADER
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String hash) |
void |
copyToFile(Path path,
java.lang.String sha1) |
static GitSystem |
createAndAddService() |
static GitSystem |
createAndAddService(Path root) |
void |
expandToPath(Path path,
java.lang.String sha1) |
void |
expandToPath(Path path,
java.lang.String sha1,
long now) |
java.lang.String |
getBlobSha1(Path path)
Writes a file to the repository
|
static GitSystem |
getCurrent() |
java.lang.String |
getMaster() |
int |
getStartPriority()
Returns the start priority of the service, used to determine which
services to start first.
|
java.lang.String |
getTag(java.lang.String tag) |
java.lang.String[] |
listRefs(java.lang.String dir) |
GitType |
objectType(java.lang.String sha1)
Returns the object type of the specified file.
|
GitObjectStream |
open(java.lang.String sha1)
Opens an object file specified by a sha1 hash.
|
java.io.InputStream |
openBlob(java.lang.String sha1)
Returns an input stream to a blob
|
java.io.InputStream |
openRawGitFile(java.lang.String sha1)
Opens a stream to the raw git file.
|
GitCommit |
parseCommit(java.lang.String sha1)
Parses and returns the commit file specified by the sha1 hash.
|
GitTree |
parseTree(java.lang.String sha1)
Parses and returns the tree (directory) specified by the sha1 hash.
|
void |
start()
Starts the service.
|
java.lang.String |
toString() |
static GitType |
validate(java.lang.String hash,
java.io.InputStream is) |
void |
validateRawGitFile(java.lang.String sha1)
Validate and remove.
|
java.lang.String |
writeCommit(GitCommit commit)
Writes a file to the repository
|
static java.lang.String |
writeData(java.io.OutputStream os,
java.lang.String type,
java.io.InputStream is,
long length) |
java.lang.String |
writeFile(Path path)
Writes a file to the repository
|
java.lang.String |
writeFile(TempOutputStream os,
java.lang.String hex) |
java.lang.String |
writeInputStream(java.io.InputStream is)
Writes a file to the repository
|
java.lang.String |
writeInputStream(java.io.InputStream is,
long length)
Writes a file to the repository
|
java.lang.String |
writeRawGitFile(java.lang.String sha1,
java.io.InputStream is)
Writes a raw git file directly to the repository with an expected
sha1.
|
void |
writeTag(java.lang.String tag,
java.lang.String hex) |
java.lang.String |
writeTree(GitTree tree)
Writes a file to the repository
|
destroy, getStopPriority, isActive, preCreate, stop
public static final int START_PRIORITY
public GitSystem(Path root)
public static GitSystem createAndAddService()
public static GitSystem getCurrent()
public int getStartPriority()
ResinSubSystem
getStartPriority
in interface ResinSubSystem
getStartPriority
in class AbstractResinSubSystem
public void start() throws java.io.IOException
ResinSubSystem
start
in interface ResinSubSystem
start
in class AbstractResinSubSystem
java.io.IOException
public java.lang.String getMaster()
public GitType objectType(java.lang.String sha1) throws java.io.IOException
sha1
- the sha1 hash identifier of the filejava.io.IOException
public java.lang.String getTag(java.lang.String tag)
public void writeTag(java.lang.String tag, java.lang.String hex)
public java.lang.String[] listRefs(java.lang.String dir)
public GitCommit parseCommit(java.lang.String sha1) throws java.io.IOException
sha1
- the sha1 hash identifier of the commit filejava.io.IOException
public GitTree parseTree(java.lang.String sha1) throws java.io.IOException
sha1
- the sha1 hash identifier of the tree filejava.io.IOException
public java.io.InputStream openBlob(java.lang.String sha1) throws java.io.IOException
java.io.IOException
public void expandToPath(Path path, java.lang.String sha1) throws java.io.IOException
java.io.IOException
public void expandToPath(Path path, java.lang.String sha1, long now) throws java.io.IOException
java.io.IOException
public void copyToFile(Path path, java.lang.String sha1) throws java.io.IOException
java.io.IOException
public boolean contains(java.lang.String hash)
public GitObjectStream open(java.lang.String sha1) throws java.io.IOException
sha1
- the sha1 hash identifier for the filejava.io.IOException
public java.lang.String writeFile(Path path) throws java.io.IOException
java.io.IOException
public java.lang.String getBlobSha1(Path path) throws java.io.IOException
java.io.IOException
public java.lang.String writeInputStream(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public java.lang.String writeInputStream(java.io.InputStream is, long length) throws java.io.IOException
java.io.IOException
public java.lang.String writeTree(GitTree tree) throws java.io.IOException
java.io.IOException
public java.lang.String writeCommit(GitCommit commit) throws java.io.IOException
java.io.IOException
public java.lang.String writeFile(TempOutputStream os, java.lang.String hex) throws java.io.IOException
java.io.IOException
public java.io.InputStream openRawGitFile(java.lang.String sha1) throws java.io.IOException
java.io.IOException
public java.lang.String writeRawGitFile(java.lang.String sha1, java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void validateRawGitFile(java.lang.String sha1)
public static GitType validate(java.lang.String hash, java.io.InputStream is) throws java.io.IOException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.NoSuchAlgorithmException
public static java.lang.String writeData(java.io.OutputStream os, java.lang.String type, java.io.InputStream is, long length) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class AbstractResinSubSystem