Class RepositoryDownloadController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

    public class RepositoryDownloadController
    extends BaseController

    This controller allows to download build artifacts and supports various URL patterns for that purposes. It is compatible with Ivy URL resolver if the following patterns are used:

    • http://host:port/context/httpAuth/repository/download/[module]/[revision]/teamcity-ivy.xml
    • http://host:port/context/httpAuth/repository/download/[module]/[revision]/[artifact].[ext]
    where
    • [module] is build type id or string in the form <project name>:<build type name>
    • [revision] is build number
    • [artifact] name of artifact without extension
    • [ext] artifact extension

    The following special revisions are supported:

    • lastPinned - to download last pinned build
    • lastSuccessful - to download last successful build
    • lastFinished - to download last finished build

    To download artifacts of the latest builds (last finished, successful or pinned) use the following URLs:

    • http://host:port/context/repository/download/[module]/.lastFinished/[artifactPath]
    • http://host:port/context/repository/download/[module]/.lastSuccessful/[artifactPath]
    • http://host:port/context/repository/download/[module]/.lastPinned/[artifactPath]

    To download artifacts by build id use this URL:

    • http://host:port/context/repository/download/[module]/[build id]:id/[artifactPath]

    To download artifacts by build number the following URL should be used:

    • http://host:port/context/repository/download/[module]/[build number]/[artifactPath]

    Since 7.0 it is possible to download files from the archives in artifacts (.zip, .jar, .tar.gz, etc. see full list in ArchiveUtil.getArchiveType(java.lang.String)). The URL you can use is:

    • http://[path-to-artifact]!/[path-in-archive]
    Author:
    Pavel.Sher Date: 05.02.2007
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  RepositoryDownloadController.RepositoryListener
      The listener of all successful artifact downloads that come through the RepositoryDownloadController.
    • Field Summary

      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(RepositoryDownloadController.RepositoryListener listener)  
      protected org.springframework.web.servlet.ModelAndView doHandle​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Performs actual request processing
      void removeListener​(RepositoryDownloadController.RepositoryListener listener)  
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

        isSynchronizeOnSession, setSynchronizeOnSession
      • Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

        applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext