public class Bitbucket
extends java.lang.Object
implements java.lang.AutoCloseable
This class allocates resources to serve network requests and therefore has to be explicitly closed when not needed. Note that doing so will invalidate all objects retrieved via this class.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
API_ENDPOINT
Default Bitbucket's API endpoint
|
| Constructor and Description |
|---|
Bitbucket(RequestAuthenticator authenticator)
Constructs an instance of Bitbucket API Facade with a given authenticator.
|
Bitbucket(RequestAuthenticator authenticator,
java.lang.String apiEndpoint)
Constructs an instance of Bitbucket API Facade with a given authenticator and a specified API
endpoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Repository |
getRepository(java.lang.String username,
java.lang.String repositoryName)
Creates a handle object to access a repository on Bitbucket.
|
public static final java.lang.String API_ENDPOINT
public Bitbucket(RequestAuthenticator authenticator)
authenticator - the authenticatorpublic Bitbucket(RequestAuthenticator authenticator, java.lang.String apiEndpoint)
authenticator - the authenticatorapiEndpoint - the API endpoint URLpublic Repository getRepository(java.lang.String username, java.lang.String repositoryName)
Repository object will be returned even if the repository with this username/repositoryName
doesn't exists on Bitbucket or authenticated account has no access to it. In such case most
methods of the returned objects will result in exception.username - the username/teamname of the ownerrepositoryName - the name of the repositorypublic void close()
close in interface java.lang.AutoCloseable