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 to AetherStubDownloaderBuilder, doesn't require the location to be a maven repository.
Author:
Marcin Grzejszczak
  • Constructor Details

    • FileStubDownloader

      public FileStubDownloader()
  • Method Details

    • 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:
      true if protocol is accepted
    • build

      public StubDownloader build(StubRunnerOptions stubRunnerOptions)
      Specified by:
      build in interface StubDownloaderBuilder
      Parameters:
      stubRunnerOptions - options of Stub Runner
      Returns:
      StubDownloader instance of null if 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:
      resolve in interface org.springframework.core.io.ProtocolResolver
      Specified by:
      resolve in interface StubDownloaderBuilder