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
Modifier and TypeMethodDescriptionList<jenkins.scm.api.SCMFile>getDirectoryContent(BitbucketSCMFile scmFile) Retrieves the list of all files and directories that can be found.jenkins.scm.api.SCMFile.TypegetFileType(String path, String ref) Retrieves thefile typefor the specified file path and ref.getRawFileStream(BitbucketSCMFile scmFile) Retrieve the bytes of a file in a repository.
-
Method Details
-
getDirectoryContent
Retrieves the list of all files and directories that can be found.- Parameters:
scmFile- the directory to retrieve- Returns:
- a list of all
SCMFiles 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
Retrieves thefile typefor 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
typefor 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
Retrieve the bytes of a file in a repository. The bytes are encapsulated in anInputStreamobject. 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
InputStreamobject. - 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
-