Class RepositoryDownloadController
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.support.WebContentGenerator
-
- org.springframework.web.servlet.mvc.AbstractController
-
- jetbrains.buildServer.controllers.BaseController
-
- jetbrains.buildServer.controllers.artifacts.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]
- [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 inArchiveUtil.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 interfaceRepositoryDownloadController.RepositoryListenerThe listener of all successful artifact downloads that come through theRepositoryDownloadController.
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.controllers.BaseController
myServer
-
-
Constructor Summary
Constructors Constructor Description RepositoryDownloadController(BuildServerEx server, DownloadedArtifactsLogger artifactLogger, RevisionRuleBuildFinders buildFinders, PresignedArtifactLinksManager presignedLinksManager, HttpDownloadProcessor downloadProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(RepositoryDownloadController.RepositoryListener listener)protected org.springframework.web.servlet.ModelAndViewdoHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Performs actual request processingvoidremoveListener(RepositoryDownloadController.RepositoryListener listener)-
Methods inherited from class jetbrains.buildServer.controllers.BaseController
getOrCreateMessages, handleRequest, handleRequestInternal, isGet, isPost, redirectTo, setExceptionResolvers, simpleView
-
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
-
-
-
-
Constructor Detail
-
RepositoryDownloadController
public RepositoryDownloadController(@NotNull BuildServerEx server, @NotNull DownloadedArtifactsLogger artifactLogger, @NotNull RevisionRuleBuildFinders buildFinders, @NotNull PresignedArtifactLinksManager presignedLinksManager, @NotNull HttpDownloadProcessor downloadProcessor)
-
-
Method Detail
-
doHandle
@Nullable protected org.springframework.web.servlet.ModelAndView doHandle(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response) throws ExceptionDescription copied from class:BaseControllerPerforms actual request processing- Specified by:
doHandlein classBaseController- Parameters:
request- HTTP requestresponse- HTTP response- Returns:
- model and view components
- Throws:
Exception- exception
-
addListener
public void addListener(@NotNull RepositoryDownloadController.RepositoryListener listener)
-
removeListener
public void removeListener(@NotNull RepositoryDownloadController.RepositoryListener listener)
-
-