Modifier and Type | Interface and Description |
---|---|
static class |
Repository.State
Enumerates the possible states for a given
repository . |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_DESCRIPTION_LENGTH
The maximum number of characters of a repository's description
|
static int |
MAX_NAME_LENGTH
The maximum number of characters of a repository's name
|
static String |
NAME_REGEXP |
static int |
SLUG_MAX_SIZE |
static String |
SLUG_REGEXP |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Retrieves the repository's description.
|
String |
getHierarchyId()
Retrieves the unique identifier for the hierarchy of forks to which this repository belongs.
|
int |
getId()
Retrieves the repository's ID, which represents its primary key.
|
String |
getName()
Retrieves the repository's name, which is guaranteed to be unique within its
project but
not within the system at large. |
Repository |
getOrigin()
Retrieves the repository from which this repository was forked, if any.
|
Project |
getProject()
Retrieves the
project to which this repository belongs. |
String |
getScmId()
Retrieves the unique identifier for the SCM used by this repository.
|
String |
getSlug()
Retrieves the "slug" for this repository, which is a URL-friendly variant of its
name . |
Repository.State |
getState()
Retrieves the repository's current
state . |
String |
getStatusMessage()
Retrieves the
status message for the repository's current state . |
boolean |
isFork()
Retrieves a flag indicating whether this repository is a fork of another repository.
|
boolean |
isForkable()
Retrieves a flag indicating whether this repository may be forked.
|
boolean |
isPublic()
Retrieves a flag indicating whether this repository is public.
|
static final int MAX_DESCRIPTION_LENGTH
static final int MAX_NAME_LENGTH
static final String NAME_REGEXP
static final int SLUG_MAX_SIZE
static final String SLUG_REGEXP
@Nullable @OptionalString(size=255, message="{com.atlassian.bitbucket.validation.repository.description.message}") String getDescription()
@Nonnull String getHierarchyId()
int getId()
@Nonnull @RequiredString(size=128, regexp="[\\p{Alnum}][\\w\\-\\. ]*", message="{com.atlassian.bitbucket.validation.repository.name.pattern.message}") String getName()
project
but
not within the system at large.@Nullable Repository getOrigin()
null
.
Note: Even when a repository's origin is null
, it will still have a hierarchy
ID
. If the repository is ever forked, its forks will inherit the same hierarchy ID.
@Nonnull Project getProject()
project
to which this repository belongs.
Note: If this repository is a fork, it's origin
repository may belong to a different
project.
@Nonnull @RequiredString String getScmId()
ScmService
@Nonnull @RequiredString(size=128, regexp="[\\p{Alnum}][\\w\\-\\.]*") String getSlug()
name
. Each
repository's slug is guaranteed to be unique within its project
, but not within
the system at large.@Nonnull Repository.State getState()
state
.@Nonnull String getStatusMessage()
status message
for the repository's current state
.boolean isFork()
true
, the
repository will always have an origin
.
Note: Even repositories that are not forks, and have not been used as the origin of a fork, still exist in a
hierarchy
; the hierarchy just consists of a single repository.
true
if this repository is a fork; otherwise, false
boolean isForkable()
isFork()
.
It is possible to create a fork from a fork, if the repository is configured so, just as it may not be possible
to create forks from some top-level repositories.
If forking is disabled
at the system level, even repositories which
are configured to allow forking (where this flag is true
) may not be forked.
true
if the repository may be forkedRepositoryService.isForkingEnabled()
boolean isPublic()
Note, this flag is taken into account when calculating whether this repository is accessible to
unauthenticated users but is not the definitive answer. For a definitive answer, use
isPubliclyAccessible
.
true
if the repository has been marked as public, false
otherwiseCopyright © 2021 Atlassian. All rights reserved.