| com.atlassian.bitbucket.project.ProjectService | 
Creates, updates and deletes projects.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new  
  
  Project and sets its avatar, if provided. | |||||||||||
Deletes the specified  
  
  project, if it exists. | |||||||||||
Retrieves a page of projects which are visible for the current user. 
  
   | |||||||||||
Retrieves the  
  
  keys for all projects the current user can see. | |||||||||||
Retrieves the current avatar for the specified project at a requested size. 
  
   | |||||||||||
Update a project's data with new values. 
  
   | |||||||||||
Updates the specified project's avatar, replacing it with the one contained in the provided data URI. 
  
   | |||||||||||
Updates the specified project's avatar, replacing it with the one contained in the provided
  
  
  supplier. | |||||||||||
| 
  [Expand]
   Inherited Methods  | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
   
From interface
  com.atlassian.bitbucket.project.ProjectSupplier
 | |||||||||||
Creates a new Project and sets its avatar, if provided.
 
Note: Both the project key and name must be unique.
| request | describes the project to create | 
|---|
| ProjectCreationCanceledException | if creation is canceled by an event listener | 
|---|---|
| ServiceException | if the specified getKey()
                                                        or getName() is not unique
 | 
        
Deletes the specified project, if it exists.
 
 Personal projects cannot be deleted. Additionally, if the project contains any
 repositories, they must all be deleted before the project
 can be deleted.
| project | the project to delete | 
|---|
true if the project was deleted; otherwise false if the project did not exist| ProjectDeletionCanceledException | if deletion is canceled by an event listener | 
|---|---|
| IntegrityException | if the project is personal,
                                                          or has repositories | 
        
| ServiceException | if the project exists and could not be deleted | 
Retrieves a page of projects which are visible for the current user.
 Note: Personal projects are never included in the returned page.
| pageRequest | the bounds of the page | 
|---|
projects to which the current user has access
Retrieves the keys for all projects the current user can see.
 
 Note: Personal projects keys are never included in the returned list.
 
 Warning: This mechanism is not paged. For systems with large numbers of projects, the returned list may
 be very large. For callers wishing to iterate over all existing projects, findAll(PageRequest) is the
 correct mechanism to use.
Retrieves the current avatar for the specified project at a requested size. Avatars are square, so the size provided here is used as both height and width for the avatar.
The requested size will be normalised to fall within a well-defined set sizes. The supported sizes are:
| projectId | the ID of the project to retrieve the avatar for | 
        
|---|---|
| size | the desired height and width for the avatar | 
| id | the ID of the project to retrieve | 
        
|---|
null if no such project exists| AuthorisationException | if the current user does not have permission to access the requested project | 
|---|
| key | the key of the project to retrieve | 
        
|---|
null if the key does not match an existing project| AuthorisationException | if the current user does not have permission to access the requested project | 
|---|
| name | the name of the project to retrieve | 
        
|---|
null if the name does not match an existing project| AuthorisationException | if the current user does not have permission to access the requested project | 
|---|
| searchRequest | a criteria describing the projects to return | 
|---|---|
| pageRequest | the bounds of the page | 
Update a project's data with new values. Project keys and names must be unique, so if the provided values match those of another Project an exception will be
 thrown.
 
 Personal projects cannot be updated. Their keys,
 names and descriptions are managed by the system.
| request | describes the project to update and the updates to apply | 
|---|
| ConstraintViolationException | if the updated key or name collide with another project | 
|---|---|
| IntegrityException | if the project is personal | 
        
| ProjectModificationCanceledException | if modification is canceled by an event listener | 
Updates the specified project's avatar, replacing it with the one contained in the provided data URI. The
 data URI is required to contain Base64-encoded image data, and should be in the format:
 
     data:(content type, e.g. image/png);base64,(data)
 
 If the data is not Base64-encoded, or if a character set is defined in the URI, it will be rejected.
 
Previous avatars are not retained. When a project's avatar is updated, the previous avatar is removed. To reuse a previous avatar, it must be provided again.
 Personal project avatars cannot be updated. Their avatars are drawn from their
 owning users. If Gravatar support is enabled, personal project avatars may
 be updated by changing the user's avatar in Gravatar. Otherwise, they may not be updated at all.
| projectId | the ID of the project to update the avatar for | 
|---|---|
| uri | a data URI containing a Base64-encoded avatar image | 
| IntegrityException | if the project is personal
 | 
        
|---|
Updates the specified project's avatar, replacing it with the one contained in the provided
 supplier.
 
Previous avatars are not retained. When a project's avatar is updated, the previous avatar is removed. To reuse a previous avatar, it must be provided again.
 Personal project avatars cannot be updated. Their avatars are drawn from their
 owning users. If Gravatar support is enabled, personal project avatars may
 be updated by changing the user's avatar in Gravatar. Otherwise, they may not be updated at all.
| projectId | the ID of the project to update the avatar for | 
|---|---|
| supplier | a supplier providing access to the new avatar to use | 
| IntegrityException | if the project is personal
 | 
        
|---|