Class FileStubDownloader
- java.lang.Object
-
- org.springframework.cloud.contract.stubrunner.FileStubDownloader
-
- All Implemented Interfaces:
StubDownloaderBuilder,org.springframework.core.io.ProtocolResolver
public class FileStubDownloader extends Object implements StubDownloaderBuilder
Allows to read stubs and contracts from a given location. Contrary toAetherStubDownloaderBuilder, doesn't require the location to be a maven repository.- Author:
- Marcin Grzejszczak
-
-
Constructor Summary
Constructors Constructor Description FileStubDownloader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StubDownloaderbuild(StubRunnerOptions stubRunnerOptions)static booleanisProtocolAccepted(String url)Does any of the accepted protocols matches the URL of the repository.org.springframework.core.io.Resourceresolve(String location, org.springframework.core.io.ResourceLoader resourceLoader)
-
-
-
Method Detail
-
isProtocolAccepted
public static boolean isProtocolAccepted(String url)
Does any of the accepted protocols matches the URL of the repository.- Parameters:
url- - of the repository- Returns:
trueif protocol is accepted
-
build
public StubDownloader build(StubRunnerOptions stubRunnerOptions)
- Specified by:
buildin interfaceStubDownloaderBuilder- Parameters:
stubRunnerOptions- options of Stub Runner- Returns:
StubDownloaderinstance ofnullif current parameters don't allow building the instance
-
resolve
public org.springframework.core.io.Resource resolve(String location, org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
resolvein interfaceorg.springframework.core.io.ProtocolResolver- Specified by:
resolvein interfaceStubDownloaderBuilder
-
-