Package dev.getelements.elements.git
Class FileSystemApplicationRepositoryResolver
java.lang.Object
dev.getelements.elements.git.FileSystemApplicationRepositoryResolver
- All Implemented Interfaces:
ApplicationRepositoryResolver
public class FileSystemApplicationRepositoryResolver
extends Object
implements ApplicationRepositoryResolver
This loads an instance of
Repository
from a place on the filesystem.
Created by patricktwohig on 8/2/17.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initDirectory
(File gitStorageDirectory) org.eclipse.jgit.lib.Repository
resolve
(Application application, Consumer<org.eclipse.jgit.lib.Repository> onCreate) Gets theRepository
for the suppliedApplication
.
-
Constructor Details
-
FileSystemApplicationRepositoryResolver
public FileSystemApplicationRepositoryResolver()
-
-
Method Details
-
resolve
public org.eclipse.jgit.lib.Repository resolve(Application application, Consumer<org.eclipse.jgit.lib.Repository> onCreate) throws Exception Description copied from interface:ApplicationRepositoryResolver
Gets theRepository
for the suppliedApplication
. This simply returns the instance ofRepository
. It is safe to assume this method will be called after the necessary security checks, therefore any security checking in this method would be redundant. If noRepository
exists, this must create the repository.- Specified by:
resolve
in interfaceApplicationRepositoryResolver
- Parameters:
application
- theApplication
onCreate
- called when the application was created- Returns:
- the
Repository
, never null - Throws:
Exception
-
getGitStorageDirectory
-
initDirectory
@Inject public void initDirectory(@Named("dev.getelements.elements.rt.git.element.storage.directory") File gitStorageDirectory)
-