Interface BitbucketFilePathClient
-
- All Known Implementing Classes:
BitbucketFilePathClientImpl
public interface BitbucketFilePathClient
Client to find the contents of files and directories in a repository- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<jenkins.scm.api.SCMFile>
getDirectoryContent(BitbucketSCMFile scmFile)
Retrieves the list of all files and directories that can be found.jenkins.scm.api.SCMFile.Type
getFileType(String path, String ref)
Retrieves thefile type
for the specified file path and ref.InputStream
getRawFileStream(BitbucketSCMFile scmFile)
Retrieve the bytes of a file in a repository.
-
-
-
Method Detail
-
getDirectoryContent
List<jenkins.scm.api.SCMFile> getDirectoryContent(BitbucketSCMFile scmFile)
Retrieves the list of all files and directories that can be found.- Parameters:
scmFile
- the directory to retrieve- Returns:
- a list of all
SCMFile
s directly contained in the directory - Throws:
AuthorizationException
- if the credentials did not allow access to the given urlNoContentException
- if the server did not respond with a bodyConnectionFailureException
- if the server did not respondNotFoundException
- if the url does not exist, or there is no file at the requested urlBadRequestException
- if the request was malformed and thus rejected by the serverServerErrorException
- if the server failed to process the requestBitbucketClientException
- for all errors not already captured
-
getFileType
jenkins.scm.api.SCMFile.Type getFileType(String path, String ref)
Retrieves thefile type
for the specified file path and ref.- Parameters:
path
- the path of the file or directory to retrieveref
- The commit ID or ref to retrieve the file for- Returns:
- the
type
for the specified file - Throws:
AuthorizationException
- if the credentials did not allow access to the given urlConnectionFailureException
- if the server did not respondBadRequestException
- if the request was malformed and thus rejected by the serverServerErrorException
- if the server failed to process the requestBitbucketClientException
- for all errors not already captured- Since:
- 4.0.0
-
getRawFileStream
InputStream getRawFileStream(BitbucketSCMFile scmFile)
Retrieve the bytes of a file in a repository. The bytes are encapsulated in anInputStream
object. The caller of this method is responsible for closing the stream.- Parameters:
scmFile
- the file to retrieve- Returns:
- the bytes of the file in an
InputStream
object. - Throws:
AuthorizationException
- if the credentials did not allow access to the given urlNoContentException
- if the server did not respond with a bodyConnectionFailureException
- if the server did not respondNotFoundException
- if the url does not exist, or there is no file at the requested urlBadRequestException
- if the request was malformed and thus rejected by the serverServerErrorException
- if the server failed to process the requestBitbucketClientException
- for all errors not already captured- Since:
- 3.3.3
-
-