Package org.apache.maven.internal.impl
Class DefaultChecksumAlgorithmService
java.lang.Object
org.apache.maven.internal.impl.DefaultChecksumAlgorithmService
- All Implemented Interfaces:
- Service,- ChecksumAlgorithmService
@Named
@Singleton
public class DefaultChecksumAlgorithmService
extends Object
implements ChecksumAlgorithmService
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.maven.api.services.ChecksumAlgorithmServiceChecksumAlgorithmService.ChecksumAlgorithm, ChecksumAlgorithmService.ChecksumCalculator
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultChecksumAlgorithmService(org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector) 
- 
Method SummaryModifier and TypeMethodDescriptioncalculate(byte[] data, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) Calculates checksums for specified data.calculate(InputStream stream, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) Calculates checksums for specified stream.calculate(ByteBuffer data, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) Calculates checksums for specified data.calculate(Path file, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) Calculates checksums for specified file.Returns immutable collection of all supported algorithm names.ReturnsChecksumAlgorithmService.ChecksumAlgorithmfor given algorithm name, or throws if algorithm not supported.select(Collection<String> algorithmNames) Returns a collection ofChecksumAlgorithmService.ChecksumAlgorithmin same order as algorithm names are ordered, or throws if any of the algorithm name is not supported.
- 
Constructor Details- 
DefaultChecksumAlgorithmService@Inject public DefaultChecksumAlgorithmService(org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector) 
 
- 
- 
Method Details- 
getChecksumAlgorithmNamesDescription copied from interface:ChecksumAlgorithmServiceReturns immutable collection of all supported algorithm names.- Specified by:
- getChecksumAlgorithmNamesin interface- ChecksumAlgorithmService
 
- 
selectDescription copied from interface:ChecksumAlgorithmServiceReturnsChecksumAlgorithmService.ChecksumAlgorithmfor given algorithm name, or throws if algorithm not supported.- Specified by:
- selectin interface- ChecksumAlgorithmService
 
- 
selectpublic Collection<ChecksumAlgorithmService.ChecksumAlgorithm> select(Collection<String> algorithmNames) Description copied from interface:ChecksumAlgorithmServiceReturns a collection ofChecksumAlgorithmService.ChecksumAlgorithmin same order as algorithm names are ordered, or throws if any of the algorithm name is not supported. The returned collection has equal count of elements as passed in collection of names, and if names contains duplicated elements, the returned list of algorithms will have duplicates as well.- Specified by:
- selectin interface- ChecksumAlgorithmService
 
- 
calculatepublic Map<ChecksumAlgorithmService.ChecksumAlgorithm,String> calculate(byte[] data, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) Description copied from interface:ChecksumAlgorithmServiceCalculates checksums for specified data.- Specified by:
- calculatein interface- ChecksumAlgorithmService
- Parameters:
- data- The content for which to calculate checksums, must not be- null.
- algorithms- The checksum algorithms to use, must not be- null.
- Returns:
- The calculated checksums, indexed by algorithms, never null.
 
- 
calculatepublic Map<ChecksumAlgorithmService.ChecksumAlgorithm,String> calculate(ByteBuffer data, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) Description copied from interface:ChecksumAlgorithmServiceCalculates checksums for specified data.- Specified by:
- calculatein interface- ChecksumAlgorithmService
- Parameters:
- data- The content for which to calculate checksums, must not be- null.
- algorithms- The checksum algorithms to use, must not be- null.
- Returns:
- The calculated checksums, indexed by algorithms, never null.
 
- 
calculatepublic Map<ChecksumAlgorithmService.ChecksumAlgorithm,String> calculate(Path file, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) throws IOException Description copied from interface:ChecksumAlgorithmServiceCalculates checksums for specified file.- Specified by:
- calculatein interface- ChecksumAlgorithmService
- Parameters:
- file- The file for which to calculate checksums, must not be- null.
- algorithms- The checksum algorithms to use, must not be- null.
- Returns:
- The calculated checksums, indexed by algorithms, never null.
- Throws:
- IOException- In case of any IO problem.
 
- 
calculatepublic Map<ChecksumAlgorithmService.ChecksumAlgorithm,String> calculate(InputStream stream, Collection<ChecksumAlgorithmService.ChecksumAlgorithm> algorithms) throws IOException Description copied from interface:ChecksumAlgorithmServiceCalculates checksums for specified stream. Upon this method returns, the stream will be depleted (fully read) but not closed.- Specified by:
- calculatein interface- ChecksumAlgorithmService
- Parameters:
- stream- The stream for which to calculate checksums, must not be- null.
- algorithms- The checksum algorithms to use, must not be- null.
- Returns:
- The calculated checksums, indexed by algorithms, never null.
- Throws:
- IOException- In case of any IO problem.
 
 
-