| com.atlassian.bitbucket.repository.RepositoryService | 
Describes a service for interacting with repositories.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Get the number of repositories that belong to a project. | |||||||||||
| Create a new repository. | |||||||||||
| Delete the repository. | |||||||||||
| Find all repositories in the system in the default namespace. | |||||||||||
| Retrieves a page of  repositorieswhich have been forked from the specifiedorigin. | |||||||||||
| Retrieves a page of  repositoriesowned by the specifieduser. | |||||||||||
| Retrieves a page of  repositoriesin the project with the given id. | |||||||||||
| List the names of the repositories in the project with the given key and with a default (null) namespace. | |||||||||||
| List the names of the repositories in the project with the given key and namespace. | |||||||||||
| Retrieves the current user's personal fork of the specified  repository. | |||||||||||
| Retrieves a page of  repositorieswhich belong to the samehierarchyas the specified repository. | |||||||||||
| Create a new repository by forking from an existing repository. | |||||||||||
| Retrieves a  Repositoryby itsID. | |||||||||||
| Retrieves a  Repositoryby itsslug. | |||||||||||
| Retrieves a  Repositoryby itsslug. | |||||||||||
| Retrieves  linksthat can be used to clone the suppliedrepositoryvia the repository'sSCM'ssupported protocols. | |||||||||||
| Calculates the size (in bytes) for the specified repository. | |||||||||||
| Retrieves a flag indicating whether the specified repository is empty or not. | |||||||||||
| Retrieves a flag indicating whether the system has been configured to allow forking repositories. | |||||||||||
| If a create operation fails, calling this method will clean up the broken repository and try again. | |||||||||||
| Searches for  repositoriesthat match the providedrequest. | |||||||||||
| Update the metadata of a repository. | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From interface
  com.atlassian.bitbucket.repository.RepositorySupplier | |||||||||||
Get the number of repositories that belong to a project.
| project | the project | 
|---|
Create a new repository. The repository's slug will be derived from the name. Both
 the name and the generated slug must be unique within the project.
 
 Before the repository is created, a creation
 requested event is raised. This event is cancelable, allowing plugins to prevent repository creation based on
 arbitrary considerations. If any listener cancels creation, the repository will not be created. It does
 not require consensus among all registered listeners. If no listeners cancel, the repository will be created.
 
Events raised:
| request | describes the repository to create | 
|---|
| RepositoryCreationCanceledException | if creation is canceled by an event listener | 
|---|
Delete the repository. Both the on-disk repository and the database record are deleted. Any child and parent relationships are updated. The repository will be scheduled for deletion, which may happen after this call completes.
 Before the repository is deleted, a deletion
 requested event is raised. This event is cancelable, allowing plugins to prevent repository deletion based on
 arbitrary considerations. If any listener cancels deletion, the repository will not be deleted. It does
 not require consensus among all registered listeners. If no listeners cancel, the repository will be deleted.
 
Events raised:
| repository | the repository to be deleted. | 
|---|
| RepositoryDeletionCanceledException | if deletion is canceled by an event listener | 
|---|
Find all repositories in the system in the default namespace.
| pageRequest | the page of repositories to return. | 
|---|
Retrieves a page of repositories which have been forked from the specified origin.
 
The returned list is not guaranteed to be complete; it will be filtered to contain only those repositories which the requesting user has access to. This may not include forks in other users' personal projects, for example.
| origin | the origin repository for which forks should be found | 
|---|---|
| pageRequest | the bounds of the page | 
Retrieves a page of repositories owned by the specified user. These
 are personal repositories, which may be personal forks of other repositories or
 the user's own repositories.
 
Only repositories visible to the current user will be returned, which may not be the full set of repositories owned by the specified user.
| owner | the user to retrieve personal repositories for | 
|---|---|
| pageRequest | the bounds of the page | 
Retrieves a page of repositories in the project with the given id.
| projectId | the ID of the project for which to list the repositories | 
|---|---|
| pageRequest | the page parameters for this query | 
null| NoSuchProjectException | if the specified project does not exist | 
|---|
List the names of the repositories in the project with the given key and with a default (null) namespace.
| projectKey | the key of the project for which to list the repositories | 
|---|---|
| pageRequest | the page parameters for this query | 
null| NoSuchProjectException | if the specified project does not exist | 
|---|
List the names of the repositories in the project with the given key and namespace. Unless in
  mirror mode the namespace specified should always
  be null.
| projectNamespace | the namespace of the project for which to list the repositories. | 
|---|---|
| projectKey | the key of the project for which to list the repositories. | 
| pageRequest | the page parameters for this query | 
null| NoSuchProjectException | if the specified project does not exist in the specified namespace | 
|---|
Retrieves the current user's personal fork of the specified repository. If the current
 user has not yet forked the repository, or has forked it with a different name,
 null will be returned.
| repository | the repository to retrieve the current user's personal fork for | 
|---|
null if the current user
         has not forked the repository or has forked it with a different name
Retrieves a page of repositories which belong to the same hierarchy as the specified repository. The specified repository will never itself be returned, even though it
 is also part of the hierarchy.
 
The related repositories returned are not guaranteed to be the complete hierarchy; they will be filtered to contain only those repositories which the requesting user has access to. This may not include other users' personal forks of the repository, for example.
| repository | the repository to retrieve related repositories for | 
|---|---|
| pageRequest | the bounds of the page | 
Create a new repository by forking from an existing repository. As with creating a repository from scratch, the fork's slug will be derived from its name,
 and both the name and the slug must be unique within the target project.
 
project is provided, the fork will be created
     in the forking user's personal project.name is provided, the
     parent repository's name is retained for the fork.fork requested event
 is raised. This event is cancelable, allowing plugins to prevent fork creation based on arbitrary considerations.
 If any listener cancels forking, the fork will not be created. It does not require consensus among all
 registered listeners. If no listeners cancel, the fork will be created.
 Events raised:
| request | describes the repository to fork, as well as the project in which the fork should be created and the name that should be assigned to it | 
|---|
| RepositoryForkCanceledException | if forking is canceled by an event listener | 
|---|---|
| FeatureUnsupportedScmException | if the SCM for the parent repository does not support forking | 
| ConstraintViolationException | if the fork's slug matches another repository within the user's personal project | 
Retrieves a Repository by its ID.
| id | the repository's ID | 
|---|
null if there is no repository with the specified ID| AuthorisationException | if the current user does not have permission to access the requested repository | 
|---|
Retrieves a Repository by its slug. Slugs are only unique within a given
 Project, so the project key is also required.
| projectKey | the keyof the project to search in | 
|---|---|
| slug | the slugof the repository to search for | 
null if no repository matches the specified slug within the specified project| AuthorisationException | if the current user does not have permission to access the requested repository | 
|---|
Retrieves a Repository by its slug. Slugs are only unique within a given
 Project, so the project key and project namespace
 are required. Unless in mirror mode the namespace
 specified should always be null.
| projectNamespace | the namespaceof the project to search in | 
|---|---|
| projectKey | the keyof the project to search in | 
| slug | the slugof the repository to search for | 
null if no repository matches the specified slug within the specified project
 and namespace
Retrieves links that can be used to clone the supplied
 repository via the repository's SCM's supported protocols.
 
 Where appropriate to the underlying SCM type, SCM protocols may return link URLs that are customised to the
 supplied user or the
 currently authenticated user (if any). This might be
 achieved, for instance, by inserting the user's name in the
 URL's authority part. Whether and how this customisation takes place is entirely up to each protocol.
 
 Each link has a name that indicates the protocol it supports
 e.g. "ssh" or "http".
| request | the request used to generate clone links | 
|---|
| AuthorisationException | if the current user does not have permission to access the requested repository | 
|---|
Calculates the size (in bytes) for the specified repository. If the provided Repository does not exist,
 its size is always 0.
 
Note: Calculating the size can be an expensive operation. The returned value may be a best effort estimation of the repository size.
| repository | the repository whose size should be calculated | 
|---|
Retrieves a flag indicating whether the specified repository is empty or not. While the definition of "empty" is SCM-specific, it generally distills to a repository which contains no branches or tags.
| repository | the repository to check | 
|---|
true if the repository is empty; otherwise false
Retrieves a flag indicating whether the system has been configured to allow forking repositories.
 In addition to this system-wide setting, each Repository may be explicitly configured as
 isForkable() or not. If forking is disabled system-wide, even repositories
 configured as forkable cannot be forked. By the same token, even if forking is enabled system-wide,
 any repository which is explicitly configured to disallow forks cannot be forked.
true if the system is configured to allow repository forking; otherwise, falseIf a create operation fails, calling this method will clean up the broken repository and try again.
 The repository must be in INITIALISATION_FAILED
 state in order to retry creation.
| repository | the repository to retry | 
|---|
| IllegalRepositoryStateException | if the repository is not in the required state | 
|---|
Searches for repositories that match the provided request.
| request | a request object describing the repositories to return | 
|---|---|
| pageRequest | the bounds of the page | 
repositories that match the provided
         criteriaUpdate the metadata of a repository. The possible updates are described in detail by the the
 RepositoryUpdateRequest documentation.
 
 Repository slugs are derived from their names.
 Updating a repository's name may change its slug, which will also change all browser and clone URLs for the
 affected repository. Old URLs will no longer work after such an update.
 
 Before the repository is updated, a modification requested event is raised. This event is cancelable, allowing plugins to prevent repository
 modification based on arbitrary considerations. If any listener cancels modification, the repository
 will not be updated. It does not require consensus among all registered listeners. If no listeners cancel,
 the repository will be updated with the provided name.
 
Events raised:
| request | describes the repository to update and the updates to apply | 
|---|
| RepositoryModificationCanceledException | if modification is canceled by an event listener | 
|---|