public class GitConnector extends ReadOnlyConnector implements Pageable
Connector that accesses the content in a local Git repository that is a clone of a remote repository.
This connector has several properties that must be configured via the RepositoryConfiguration:
directoryPath - The path to the folder that is or contains the .git data
structure is to be accessed by this connector.remoteName - The alias used by the local Git repository for the remote repository. The
default is the "origin". If the value contains commas, the value contains an ordered list of remote aliases that
should be searched; the first one to match an existing remote will be used.queryableBranches - An array with the names of the branches that should be queryable by the
repository. By default, only the master branch is queryable.The connector results in the following structure:
| Path | Description |
|---|---|
/branches/{branchName} |
The list of branches. |
/tags/{tagName} |
The list of tags. |
/commits/{branchOrTagNameOrCommit}/{objectId} |
The history of commits on the branch, tag or object ID name "{branchOrTagNameOrCommit}", where "
{objectId}" is the object ID of the commit. |
/commit/{branchOrTagNameOrCommit} |
The information about a particular branch, tag or commit "{branchOrTagNameOrCommit}". |
/tree/{branchOrTagOrObjectId}/{filesAndFolders}/... |
The structure of the directories and files in the specified branch, tag or commit "{branchOrTagNameOrCommit}".
|
Connector.ExtraPropertiesDEFAULT_ROOT_ID| Constructor and Description |
|---|
GitConnector() |
| Modifier and Type | Method and Description |
|---|---|
ExternalBinaryValue |
getBinaryValue(String id) |
Document |
getChildReference(String parentKey,
String childKey) |
Document |
getChildren(PageKey pageKey) |
Document |
getDocumentById(String id) |
String |
getDocumentId(String path) |
Collection<String> |
getDocumentPathsById(String id) |
boolean |
hasDocument(String id) |
protected boolean |
includeMimeType() |
void |
initialize(javax.jcr.NamespaceRegistry registry,
NodeTypeManager nodeTypeManager) |
protected DocumentWriter |
newDocumentWriter(String id) |
protected String |
remoteName() |
protected List<String> |
remoteNames() |
void |
shutdown() |
isReadonly, newDocumentId, removeDocument, storeDocument, updateDocumentcheckFieldNotNull, extraPropertiesFor, extraPropertiesStore, factories, getContext, getEnvironment, getLogger, getMimeTypeDetector, getRepositoryName, getRootDocumentId, getSourceName, getTransactionManager, isCacheable, isQueryable, log, moveExtraProperties, nameFrom, nameFrom, nameFrom, newChildReference, newConnectorChangedSet, newDocument, newPageDocument, pathFactory, pathFrom, pathFrom, propertyFactory, readDocument, setExtraPropertiesStore, translator, writeDocumentpublic GitConnector()
public void initialize(javax.jcr.NamespaceRegistry registry, NodeTypeManager nodeTypeManager) throws javax.jcr.RepositoryException, IOException
initialize in class Connectorjavax.jcr.RepositoryExceptionIOExceptionprotected DocumentWriter newDocumentWriter(String id)
protected boolean includeMimeType()
public Document getDocumentById(String id)
getDocumentById in class Connectorpublic Document getChildren(PageKey pageKey)
getChildren in interface Pageablepublic Document getChildReference(String parentKey, String childKey)
getChildReference in class Connectorpublic String getDocumentId(String path)
getDocumentId in class Connectorpublic Collection<String> getDocumentPathsById(String id)
getDocumentPathsById in class Connectorpublic boolean hasDocument(String id)
hasDocument in class Connectorpublic ExternalBinaryValue getBinaryValue(String id)
getBinaryValue in class Connectorprotected final String remoteName()
protected final List<String> remoteNames()
Copyright © 2008–2018 JBoss, a division of Red Hat. All rights reserved.