Class GHFile
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.entities.repositories.GHFile
- All Implemented Interfaces:
HttpRequestInterface,JSONHelper
This class represents a GitHub file.
It provides methods for fetching data about the file such as its name, path, SHA, size, URLs, and type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T> -
Constructor Summary
ConstructorsConstructorDescriptionGHFile(org.json.JSONObject jsonObject) Constructs a new GHFile instance with the provided JSON object. -
Method Summary
Modifier and TypeMethodDescriptionReturns the download URL of the file.Returns the Git URL of the file.Returns the HTML URL of the file.getName()Returns the name of the file.getPath()Returns the path of the file.getSha()Returns the SHA of the file.intgetSize()Returns the size of the file.getType()Returns the type of the file.getUrl()Returns the URL of the file.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl, toJSONObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequestMethods inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Constructor Details
-
GHFile
public GHFile(org.json.JSONObject jsonObject) Constructs a new GHFile instance with the provided JSON object.- Parameters:
jsonObject- the JSON object containing the file data
-
-
Method Details
-
getHtmlUrl
Returns the HTML URL of the file.- Returns:
- the HTML URL of the file
-
getUrl
Returns the URL of the file.- Returns:
- the URL of the file
-
getName
Returns the name of the file.- Returns:
- the name of the file
-
getSize
public int getSize()Returns the size of the file.- Returns:
- the size of the file
-
getDownloadUrl
Returns the download URL of the file.- Returns:
- the download URL of the file
-
getGitUrl
Returns the Git URL of the file.- Returns:
- the Git URL of the file
-
getPath
Returns the path of the file.- Returns:
- the path of the file
-
getSha
Returns the SHA of the file.- Returns:
- the SHA of the file
-
getType
Returns the type of the file.- Returns:
- the type of the file
-