Package com.lariflix.jemm.core
Class LoadServerInfo
java.lang.Object
com.lariflix.jemm.core.LoadServerInfo
The LoadServerInfo class is responsible for loading server information from a Jellyfin instance.
It uses the Jellyfin API to request server information and parse the response.
- Since:
- 1.2.0
- Version:
- 1.0
- Author:
- CesarBianchi
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the LoadServerInfo class.LoadServerInfo
(String url, String apiToken) Constructor for the LoadServerInfo class with parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets the API token for authentication.Gets the full URL for the API request, including the API token.Gets the URL of the Jellyfin instance.Requests server information from the Jellyfin instance.void
setApiToken
(String apiToken) Sets the API token for authentication.void
setJellyfinInstanceUrl
(String jellyfinInstanceUrl) Sets the URL of the Jellyfin instance.
-
Constructor Details
-
LoadServerInfo
public LoadServerInfo()Default constructor for the LoadServerInfo class.- Since:
- 1.2.0
-
LoadServerInfo
Constructor for the LoadServerInfo class with parameters.- Parameters:
url
- The URL of the Jellyfin instance.apiToken
- The API token for authentication.- Since:
- 1.2.0
-
-
Method Details
-
getJellyfinInstanceUrl
Gets the URL of the Jellyfin instance.- Returns:
- The URL of the Jellyfin instance.
- Since:
- 1.2.0
-
setJellyfinInstanceUrl
Sets the URL of the Jellyfin instance.- Parameters:
jellyfinInstanceUrl
- The URL of the Jellyfin instance.- Since:
- 1.2.0
-
getApiToken
Gets the API token for authentication.- Returns:
- The API token.
- Since:
- 1.2.0
-
setApiToken
Sets the API token for authentication.- Parameters:
apiToken
- The API token.- Since:
- 1.2.0
-
requestServerInfo
public JellyfinServerInfo requestServerInfo() throws MalformedURLException, IOException, org.json.simple.parser.ParseExceptionRequests server information from the Jellyfin instance.- Returns:
- A JellyfinServerInfo object containing the server information.
- Throws:
MalformedURLException
- If the URL is malformed.IOException
- If an I/O error occurs.org.json.simple.parser.ParseException
- If a parsing error occurs.- Since:
- 1.2.0
-
getFullURL
Gets the full URL for the API request, including the API token.- Returns:
- The full URL for the API request.
- Since:
- 1.2.0
-