Class WebCassandraDirectoryProvider
- java.lang.Object
-
- com.github.nosan.embedded.cassandra.WebCassandraDirectoryProvider
-
- All Implemented Interfaces:
CassandraDirectoryProvider
public class WebCassandraDirectoryProvider extends Object implements CassandraDirectoryProvider
An implementation ofCassandraDirectoryProviderthat downloads and extracts a Cassandra archive from well-known URLs into the specified download directory.If the Cassandra archive has already been extracted into the directory, it will be used directly, skipping the downloading and extraction steps.
- Since:
- 4.0.0
- Author:
- Dmytro Nosan
-
-
Constructor Summary
Constructors Constructor Description WebCassandraDirectoryProvider()WebCassandraDirectoryProvider(HttpClient httpClient)WebCassandraDirectoryProvider(HttpClient httpClient, Path downloadDirectory)Creates a newWebCassandraDirectoryProviderwith providedHttpClientand download directory.WebCassandraDirectoryProvider(Path downloadDirectory)Creates a newWebCassandraDirectoryProviderwithJdkHttpClientand provided download directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathgetDirectory(Version version)Returns the path to the Cassandra directory for the specified version.
-
-
-
Constructor Detail
-
WebCassandraDirectoryProvider
public WebCassandraDirectoryProvider()
-
WebCassandraDirectoryProvider
public WebCassandraDirectoryProvider(HttpClient httpClient)
- Parameters:
httpClient- http client to use
-
WebCassandraDirectoryProvider
public WebCassandraDirectoryProvider(Path downloadDirectory)
Creates a newWebCassandraDirectoryProviderwithJdkHttpClientand provided download directory.- Parameters:
downloadDirectory- the download directory
-
WebCassandraDirectoryProvider
public WebCassandraDirectoryProvider(HttpClient httpClient, Path downloadDirectory)
Creates a newWebCassandraDirectoryProviderwith providedHttpClientand download directory.- Parameters:
httpClient- http client to usedownloadDirectory- the download directory
-
-
Method Detail
-
getDirectory
public final Path getDirectory(Version version) throws IOException
Description copied from interface:CassandraDirectoryProviderReturns the path to the Cassandra directory for the specified version.- Specified by:
getDirectoryin interfaceCassandraDirectoryProvider- Parameters:
version- the Cassandra version- Returns:
- the path to the Cassandra directory
- Throws:
IOException- if an I/O error occurs
-
-