Package com.lariflix.jemm.core
Class CheckJellyfinConnection
java.lang.Object
com.lariflix.jemm.core.CheckJellyfinConnection
This class is used to check the connection to the Jellyfin server.
- Since:
- 1.0
- Author:
- Cesar Bianchi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes any resources required by this utility.tryConnection(String cURL, String cApiKey) Tries to establish a connection to the Jellyfin server.
-
Constructor Details
-
CheckJellyfinConnection
public CheckJellyfinConnection()
-
-
Method Details
-
CheckJellyfinConnection
public void CheckJellyfinConnection()Initializes any resources required by this utility. Note: this method is named similarly to a constructor but is declared with a return type and therefore is not a true Java constructor. It can be invoked to perform explicit initialization if needed.- Since:
- 1.0
-
tryConnection
public JellyfinConnectionResult tryConnection(String cURL, String cApiKey) throws MalformedURLException Tries to establish a connection to the Jellyfin server.This method performs a synchronous HTTP GET against the server's
Usersendpoint using the provided API key. It performs network I/O and may block the calling thread; callers should invoke it from a background thread if used in a GUI application.- Parameters:
cURL- The base URL of the Jellyfin server (must include protocol and trailing slash as appropriate).cApiKey- The API key for the Jellyfin server.- Returns:
- A
JellyfinConnectionResultcontaining:responseCode— the HTTP response code (0 if not attempted)isConnected—truewhen the server responded with 200message— the HTTP response message or an explanatory text
- Throws:
MalformedURLException- If the provided URL is not valid.- Since:
- 1.0
- See Also:
-