Package org.gitlab4j.api.models
Class RepositoryFile
java.lang.Object
org.gitlab4j.api.models.RepositoryFile
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencodeAndSetContent(byte[] byteContent) Encodes the provided byte array using Base64 and sets it as the content.voidencodeAndSetContent(String content) Encodes the provided String using Base64 and sets it as the content.byte[]Returns the content as a byte array, decoding from base64 if necessary.Returns the content as a String, base64 decoding it if necessary.getRef()getSize()voidvoidsetCommitId(String commitId) voidsetContent(String content) voidsetContentSha256(String contentSha256) voidsetEncoding(Constants.Encoding encoding) voidsetFileName(String fileName) voidsetFilePath(String filePath) voidsetLastCommitId(String lastCommitId) voidvoidtoString()
-
Constructor Details
-
RepositoryFile
public RepositoryFile()
-
-
Method Details
-
getFileName
-
setFileName
-
getFilePath
-
setFilePath
-
getSize
-
setSize
-
getEncoding
-
setEncoding
-
getContent
-
setContent
-
getContentSha256
-
setContentSha256
-
getRef
-
setRef
-
getBlobId
-
setBlobId
-
getCommitId
-
setCommitId
-
getLastCommitId
-
setLastCommitId
-
getDecodedContentAsString
Returns the content as a String, base64 decoding it if necessary. For binary files it is recommended to use getDecodedContentAsBytes()- Returns:
- the content as a String, base64 decoding it if necessary
-
getDecodedContentAsBytes
public byte[] getDecodedContentAsBytes()Returns the content as a byte array, decoding from base64 if necessary. For String content it is recommended to use getDecodedContent().- Returns:
- the content as a byte array, decoding from base64 if necessary
-
encodeAndSetContent
Encodes the provided String using Base64 and sets it as the content. The encoding property of this instance will be set to base64.- Parameters:
content- the String content to encode and set as the base64 encoded String content
-
encodeAndSetContent
public void encodeAndSetContent(byte[] byteContent) Encodes the provided byte array using Base64 and sets it as the content. The encoding property of this instance will be set to base64.- Parameters:
byteContent- the byte[] content to encode and set as the base64 encoded String content
-
toString
-