Package sonia.scm.repository
Class AbstractSimpleRepositoryHandler<C extends RepositoryConfig>
java.lang.Object
sonia.scm.repository.AbstractRepositoryHandler<C>
sonia.scm.repository.AbstractSimpleRepositoryHandler<C>
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Handler<Repository>
,HandlerBase<Repository>
,Initable
,RepositoryDirectoryHandler
,RepositoryHandler
public abstract class AbstractSimpleRepositoryHandler<C extends RepositoryConfig>
extends AbstractRepositoryHandler<C>
implements RepositoryDirectoryHandler
-
Field Summary
FieldsFields inherited from class sonia.scm.repository.AbstractRepositoryHandler
baseDirectory, config, store
Fields inherited from interface sonia.scm.repository.RepositoryDirectoryHandler
REPOSITORIES_NATIVE_DIRECTORY
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractSimpleRepositoryHandler
(ConfigurationStoreFactory storeFactory, RepositoryLocationResolver repositoryLocationResolver, PluginLoader pluginLoader) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExtendedCommand
buildCreateCommand
(Repository repository, File directory) create
(Repository repository) Persists a new object.protected void
create
(Repository repository, File directory) protected C
void
delete
(Repository repository) Removes a persistent object.getDirectory
(String repositoryId) Get the current directory of the repository for the given id.protected String
getStringFromResource
(String resource, String defaultContent) Returns the content of a classpath resource or the given default content.Returns information about the version of the RepositoryHandler.void
void
modify
(Repository repository) Modifies a persistent object.protected void
postCreate
(Repository repository, File directory) Methods inherited from class sonia.scm.repository.AbstractRepositoryHandler
close, getConfig, getConfigClass, getImportHandler, init, isConfigured, setConfig, storeConfig
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface sonia.scm.Handler
isConfigured
Methods inherited from interface sonia.scm.repository.RepositoryHandler
getImportHandler, getType
-
Field Details
-
DEFAULT_VERSION_INFORMATION
- See Also:
-
-
Constructor Details
-
AbstractSimpleRepositoryHandler
public AbstractSimpleRepositoryHandler(ConfigurationStoreFactory storeFactory, RepositoryLocationResolver repositoryLocationResolver, PluginLoader pluginLoader)
-
-
Method Details
-
create
Description copied from interface:HandlerBase
Persists a new object.- Specified by:
create
in interfaceHandlerBase<C extends RepositoryConfig>
-
delete
Description copied from interface:HandlerBase
Removes a persistent object.- Specified by:
delete
in interfaceHandlerBase<C extends RepositoryConfig>
-
loadConfig
public void loadConfig()- Overrides:
loadConfig
in classAbstractRepositoryHandler<C extends RepositoryConfig>
-
modify
Description copied from interface:HandlerBase
Modifies a persistent object.- Specified by:
modify
in interfaceHandlerBase<C extends RepositoryConfig>
-
getDirectory
Description copied from interface:RepositoryDirectoryHandler
Get the current directory of the repository for the given id.- Specified by:
getDirectory
in interfaceRepositoryDirectoryHandler
-
getVersionInformation
Description copied from interface:RepositoryHandler
Returns information about the version of the RepositoryHandler.- Specified by:
getVersionInformation
in interfaceRepositoryHandler
-
buildCreateCommand
-
create
- Throws:
IOException
-
createInitialConfig
-
postCreate
- Throws:
IOException
-
getStringFromResource
Returns the content of a classpath resource or the given default content.- Parameters:
resource
- path of a classpath resourcedefaultContent
- default content to return- Returns:
- content of a classpath resource or defaultContent
-