public class

RepositoryForkRequest

extends AbstractRepositoryRequest
java.lang.Object
   ↳ com.atlassian.bitbucket.repository.AbstractRepositoryRequest
     ↳ com.atlassian.bitbucket.repository.RepositoryForkRequest

Class Overview

Defines the properties that can be set when forking a Repository. To reduce backwards compatibility issues as new properties are added over time, instances of this class may only be created using its RepositoryForkRequest.Builder.

The following property is required:

The following properties, if not specified, will have defaults applied:
  • getName(): Defaults to the parent repository's name if not explicitly specified
  • getProject(): Defaults to the forking user's personal project if not explicitly specified
  • isForkable(): Defaults to true, meaning the fork will itself be forkable, if not explicitly specified
  • isPublic(): Defaults to false, meaning the fork will will not be public, if not explicitly specified
The fork's slug, which is used in URLs (both for the browser and when cloning), will be generated from the provided getName(). Both the name and the generated slug must be unique within the project or the fork cannot be created.

Summary

Nested Classes
class RepositoryForkRequest.Builder Constructs requests for forking repositories. 
Public Methods
@Nonnull Repository getParent()
Retrieves the repository to be forked.
@Nullable Project getProject()
Retrieves the project in which the fork should be created, or null to create the fork in the current user's personal project.
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.repository.AbstractRepositoryRequest
From class java.lang.Object

Public Methods

@Nonnull public Repository getParent ()

Retrieves the repository to be forked. This will become the origin of the new fork.

Returns
  • the repository to be forked

@Nullable public Project getProject ()

Retrieves the project in which the fork should be created, or null to create the fork in the current user's personal project.

Returns
  • the destination repository, or null to use the current user's personal project