Enum Class DependencyRepository
- All Implemented Interfaces:
Serializable, Comparable<DependencyRepository>, Constable
Represents a repository which contains
Dependencys.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMaven Central.Maven Central mirror repository. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]download(Dependency dependency) Downloads the raw bytes of thedependency, and ensures the downloaded bytes match the checksum.voiddownload(Dependency dependency, Path file) Downloads thedependencyto thefile, ensuring the downloaded bytes match the checksum.byte[]downloadRaw(Dependency dependency) Downloads the raw bytes of thedependency.protected URLConnectionopenConnection(Dependency dependency) Opens a connection to the givendependency.static DependencyRepositoryReturns the enum constant of this class with the specified name.static DependencyRepository[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MAVEN_CENTRAL_MIRROR
Maven Central mirror repository.This is used to reduce the load on repo.maven.org.
Although Maven Central is technically a CDN, it is meant for developer use, not end-user products. It is trivial and not very expensive for us to provide a mirror, which will absorb any traffic caused by LP.
LuckPerms will fallback to the real-thing if the mirror ever goes offline. Retrieved content is validated with a checksum, so there is no risk to integrity.
-
MAVEN_CENTRAL
Maven Central.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
openConnection
Opens a connection to the givendependency.- Parameters:
dependency- the dependency to download- Returns:
- the connection
- Throws:
IOException- if unable to open a connection
-
downloadRaw
Downloads the raw bytes of thedependency.- Parameters:
dependency- the dependency to download- Returns:
- the downloaded bytes
- Throws:
DependencyDownloadException- if unable to download
-
download
Downloads the raw bytes of thedependency, and ensures the downloaded bytes match the checksum.- Parameters:
dependency- the dependency to download- Returns:
- the downloaded bytes
- Throws:
DependencyDownloadException- if unable to download
-
download
Downloads thedependencyto thefile, ensuring the downloaded bytes match the checksum.- Parameters:
dependency- the dependency to downloadfile- the file to write to- Throws:
DependencyDownloadException- if unable to download
-