Class CoffeePickRuntimeRepositoryContext
java.lang.Object
com.io7m.coffeepick.client.vanilla.CoffeePickRuntimeRepositoryContext
- All Implemented Interfaces:
RuntimeRepositoryContextType
public final class CoffeePickRuntimeRepositoryContext extends java.lang.Object implements RuntimeRepositoryContextType
The default runtime repository context implementation.
-
Method Summary
Modifier and Type Method Description java.nio.file.Path
cacheDirectory()
java.net.http.HttpClient
httpClient()
static RuntimeRepositoryContextType
open(java.nio.file.Path base_directory, java.net.http.HttpClient http)
Open a new context.
-
Method Details
-
open
public static RuntimeRepositoryContextType open(java.nio.file.Path base_directory, java.net.http.HttpClient http) throws java.io.IOExceptionOpen a new context.- Parameters:
base_directory
- The base directory against which repositories will resolve pathshttp
- The HTTP client used for requests- Returns:
- A new context
- Throws:
java.io.IOException
- On I/O errors
-
cacheDirectory
public java.nio.file.Path cacheDirectory()- Specified by:
cacheDirectory
in interfaceRuntimeRepositoryContextType
- Returns:
- The base cache directory
-
httpClient
public java.net.http.HttpClient httpClient()- Specified by:
httpClient
in interfaceRuntimeRepositoryContextType
- Returns:
- An HTTP client to be used for requests
-