Class RepositoryFile

java.lang.Object
org.gitlab4j.api.models.RepositoryFile

public class RepositoryFile
extends Object
  • Constructor Details

    • RepositoryFile

      public RepositoryFile()
  • Method Details

    • getFileName

      public String getFileName()
    • setFileName

      public void setFileName​(String fileName)
    • getFilePath

      public String getFilePath()
    • setFilePath

      public void setFilePath​(String filePath)
    • getSize

      public Integer getSize()
    • setSize

      public void setSize​(Integer size)
    • getEncoding

      public Constants.Encoding getEncoding()
    • setEncoding

      public void setEncoding​(Constants.Encoding encoding)
    • getContent

      public String getContent()
    • setContent

      public void setContent​(String content)
    • getContentSha256

      public String getContentSha256()
    • setContentSha256

      public void setContentSha256​(String contentSha256)
    • getRef

      public String getRef()
    • setRef

      public void setRef​(String ref)
    • getBlobId

      public String getBlobId()
    • setBlobId

      public void setBlobId​(String blobId)
    • getCommitId

      public String getCommitId()
    • setCommitId

      public void setCommitId​(String commitId)
    • getLastCommitId

      public String getLastCommitId()
    • setLastCommitId

      public void setLastCommitId​(String lastCommitId)
    • getDecodedContentAsString

      public String 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

      public void encodeAndSetContent​(String content)
      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

      public String toString()
      Overrides:
      toString in class Object