Interface URLContentRetriever


  • public interface URLContentRetriever
    Artifact dependency transport. Basic transport used to retrieve artifact dependencies from build server during artifact resolution. Author: Nikita.Skvortsov Date: 1/18/11
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String downloadUrlTo​(java.lang.String url, java.io.File target)
      Download artifact to given location.
      java.lang.String getDigest​(java.lang.String url)
      Retrieve content's digest.
      void interrupt()
      Interrupt operation.
    • Method Detail

      • downloadUrlTo

        @Nullable
        java.lang.String downloadUrlTo​(@NotNull
                                       java.lang.String url,
                                       @NotNull
                                       java.io.File target)
                                throws java.io.IOException
        Download artifact to given location. Implementation is expected to write file only if the content was fetched successfully
        Parameters:
        url - source url to get artifact from
        target - target file location
        Returns:
        digest of downloaded context, or null if the content can not be retrieved by this transport
        Throws:
        java.io.IOException - if operation failed, can also throw RecoverableIOException if operation can be repeated
      • getDigest

        @Nullable
        java.lang.String getDigest​(@NotNull
                                   java.lang.String url)
                            throws java.io.IOException
        Retrieve content's digest. The digest will be compared with locally stored value to see if content has changed and must be downloaded again.
        Implementation is expected not to download whole content to get the digest.
        Parameters:
        url - source url of the artifact to retrieve digest for
        Returns:
        the digest or null, if the digest can not be retrieved by this transport
        Throws:
        java.io.IOException - if operation failed
      • interrupt

        void interrupt()
        Interrupt operation. Interrupts current transfer operation as early as possible. Will be called from external thread, so implementation should be thread-safe. Main thread is expected to throw ResolvingInterruptedException when interrupt is received