jetbrains.buildServer.controllers
Class FileBrowseController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by jetbrains.buildServer.controllers.BaseController
                      extended by jetbrains.buildServer.controllers.BaseFormXmlController
                          extended by jetbrains.buildServer.controllers.MultipartFormController
                              extended by jetbrains.buildServer.controllers.FileBrowseController
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

public abstract class FileBrowseController
extends MultipartFormController

Since:
7.0
Author:
Maxim Podkolzine (maxim.podkolzine@jetbrains.com)

Nested Class Summary
protected static interface FileBrowseController.Action
           
protected  class FileBrowseController.FileBrowseBean
           
 
Field Summary
protected  java.io.File myRootDirectory
           
protected  SecurityContext mySecurityContext
           
protected  WebAccess myWebAccess
           
 
Fields inherited from class jetbrains.buildServer.controllers.BaseController
myServer
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
FileBrowseController(SBuildServer server, SecurityContext securityContext, WebControllerManager webControllerManager, AuthorizationInterceptor interceptor, WebAccessService webAccessService, java.io.File rootDirectory, java.lang.String urlPath)
           
 
Method Summary
protected  void deleteFile(java.lang.String fileName)
           
protected  org.springframework.web.servlet.ModelAndView doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implement this method to process GET requests.
protected  org.springframework.web.servlet.ModelAndView doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void editFile(java.lang.String fileName, java.lang.String content)
           
protected  org.springframework.web.servlet.ModelAndView error(org.springframework.web.servlet.ModelAndView modelAndView, java.lang.String error)
           
protected  PermissionChecker getDownloadPermissionChecker()
           
protected  java.io.File getFileFromRequest(javax.servlet.http.HttpServletRequest request)
           
protected abstract  Permission getPermission()
           
protected  java.lang.String getRelativePath(java.lang.String filePath)
           
protected  RequestPermissionsChecker getRequestPermissionsChecker()
           
protected abstract  java.lang.String getRootDirectoryDescription()
           
protected  Browser getTreeBrowser()
           
protected  LazyTreeElementRenderer getTreeElementRenderer()
           
protected abstract  java.lang.String getTreeName()
           
protected abstract  java.lang.String getUploadResponseJsBase()
           
protected  java.lang.String getUploadResponseView()
           
protected abstract  WebAccessHelper getWebAccessHelper()
           
protected  boolean isDeleteSupported()
           
protected  boolean isEditSupported()
           
protected  boolean isUploadSupported()
           
protected  boolean isUploadToAnySubdirectory()
           
protected  org.springframework.web.servlet.ModelAndView processAction(java.lang.String actionName, javax.servlet.http.HttpServletRequest request, java.lang.String fileName)
           
 
Methods inherited from class jetbrains.buildServer.controllers.MultipartFormController
doHandle, doPost, getMultipartFileOrFail
 
Methods inherited from class jetbrains.buildServer.controllers.BaseFormXmlController
addMessage, bindFromRequest, forgetFormBean, forgetFormBean, getOrCreateFormBean, getOrCreateFormBean, isInitPageRequest, selfRedirectOnInit, writeErrors, writeRedirect
 
Methods inherited from class jetbrains.buildServer.controllers.BaseController
getOrCreateMessages, handleRequestInternal, isGet, isPost, simpleView
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
 
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, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mySecurityContext

protected final SecurityContext mySecurityContext

myRootDirectory

protected final java.io.File myRootDirectory

myWebAccess

protected WebAccess myWebAccess
Constructor Detail

FileBrowseController

public FileBrowseController(@NotNull
                            SBuildServer server,
                            @NotNull
                            SecurityContext securityContext,
                            @NotNull
                            WebControllerManager webControllerManager,
                            @NotNull
                            AuthorizationInterceptor interceptor,
                            @NotNull
                            WebAccessService webAccessService,
                            @NotNull
                            java.io.File rootDirectory,
                            @NotNull
                            java.lang.String urlPath)
Method Detail

getPermission

@NotNull
protected abstract Permission getPermission()

getRequestPermissionsChecker

@Nullable
protected RequestPermissionsChecker getRequestPermissionsChecker()

getDownloadPermissionChecker

@NotNull
protected PermissionChecker getDownloadPermissionChecker()

getTreeBrowser

@NotNull
protected Browser getTreeBrowser()

getTreeElementRenderer

@NotNull
protected LazyTreeElementRenderer getTreeElementRenderer()

getTreeName

@NotNull
protected abstract java.lang.String getTreeName()

getRootDirectoryDescription

@NotNull
protected abstract java.lang.String getRootDirectoryDescription()

getWebAccessHelper

@NotNull
protected abstract WebAccessHelper getWebAccessHelper()

isUploadSupported

protected boolean isUploadSupported()

isUploadToAnySubdirectory

protected boolean isUploadToAnySubdirectory()

getUploadResponseView

@NotNull
protected java.lang.String getUploadResponseView()

getUploadResponseJsBase

@NotNull
protected abstract java.lang.String getUploadResponseJsBase()

isDeleteSupported

protected boolean isDeleteSupported()

deleteFile

protected void deleteFile(@NotNull
                          java.lang.String fileName)

isEditSupported

protected boolean isEditSupported()

editFile

protected void editFile(@NotNull
                        java.lang.String fileName,
                        @Nullable
                        java.lang.String content)

getFileFromRequest

@Nullable
protected java.io.File getFileFromRequest(@NotNull
                                                   javax.servlet.http.HttpServletRequest request)

getRelativePath

@NotNull
protected java.lang.String getRelativePath(@NotNull
                                                   java.lang.String filePath)

doGet

protected org.springframework.web.servlet.ModelAndView doGet(@NotNull
                                                             javax.servlet.http.HttpServletRequest request,
                                                             @NotNull
                                                             javax.servlet.http.HttpServletResponse response)
Description copied from class: BaseFormXmlController
Implement this method to process GET requests. Usually on GET request a form bean is created and a page is shown.

Overrides:
doGet in class MultipartFormController
Parameters:
request - HTTP request
response - HTTP response
Returns:
model and view components

doPost

protected org.springframework.web.servlet.ModelAndView doPost(javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
Specified by:
doPost in class MultipartFormController

processAction

@Nullable
protected org.springframework.web.servlet.ModelAndView processAction(@NotNull
                                                                              java.lang.String actionName,
                                                                              @NotNull
                                                                              javax.servlet.http.HttpServletRequest request,
                                                                              @NotNull
                                                                              java.lang.String fileName)

error

@NotNull
protected org.springframework.web.servlet.ModelAndView error(@NotNull
                                                                     org.springframework.web.servlet.ModelAndView modelAndView,
                                                                     @NotNull
                                                                     java.lang.String error)