Example usage for org.springframework.web.bind.annotation RequestMethod HEAD

List of usage examples for org.springframework.web.bind.annotation RequestMethod HEAD

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod HEAD.

Prototype

RequestMethod HEAD

To view the source code for org.springframework.web.bind.annotation RequestMethod HEAD.

Click Source Link

Usage

From source file:edu.isi.misd.scanner.network.registry.web.controller.SitePolicyController.java

@RequestMapping(value = ENTITY_PATH, method = { RequestMethod.GET,
        RequestMethod.HEAD }, produces = HEADER_JSON_MEDIA_TYPE)
public @ResponseBody SitePolicy getSitePolicy(@PathVariable(ID_URL_PATH_VAR) Integer id) {
    SitePolicy foundSitePolicy = sitePolicyRepository.findOne(id);

    if (foundSitePolicy == null) {
        throw new ResourceNotFoundException(id);
    }/*from w  ww.  j  av a  2  s.  c  o m*/
    return foundSitePolicy;
}

From source file:edu.isi.misd.scanner.network.registry.web.controller.StudyRoleController.java

@RequestMapping(value = ENTITY_PATH, method = { RequestMethod.GET,
        RequestMethod.HEAD }, produces = HEADER_JSON_MEDIA_TYPE)
public @ResponseBody StudyRole getStudyRole(@PathVariable(ID_URL_PATH_VAR) Integer id) {
    StudyRole foundStudyRole = studyRoleRepository.findOne(id);

    if (foundStudyRole == null) {
        throw new ResourceNotFoundException(id);
    }/*from  w ww . ja  v a2 s . c o  m*/
    return foundStudyRole;
}

From source file:edu.isi.misd.scanner.network.registry.web.controller.ToolLibraryController.java

@RequestMapping(value = ENTITY_PATH, method = { RequestMethod.GET,
        RequestMethod.HEAD }, produces = HEADER_JSON_MEDIA_TYPE)
public @ResponseBody ToolLibrary getToolLibrary(@PathVariable(ID_URL_PATH_VAR) Integer id) {
    ToolLibrary toolLib = toolLibraryRepository.findOne(id);

    if (toolLib == null) {
        throw new ResourceNotFoundException(id);
    }//www.  ja va  2  s . co  m
    return toolLib;
}

From source file:com.card.loop.xyz.controller.LearningElementController.java

@RequestMapping(value = "/downloadLE", method = RequestMethod.HEAD)
public void getFileHeader(HttpServletRequest request, HttpServletResponse response,
        @RequestParam("id") String elementID) throws IOException {
    GridFSDBFile element = dao.getSingleLE(elementID, "le.meta");
    String path = AppConfig.DOWNLOAD_BASE_PATH + element.getFilename();
    File f = new File(path);
    System.out.println("DABOYY");
    ContentShipper shipper = new ContentShipper(request, response, true);
    shipper.ship(path);//from  w w  w .j  a  v a 2 s.co m

    f.delete();
}

From source file:edu.isi.misd.scanner.network.registry.web.controller.StudyManagementPolicyController.java

@RequestMapping(value = ENTITY_PATH, method = { RequestMethod.GET,
        RequestMethod.HEAD }, produces = HEADER_JSON_MEDIA_TYPE)
public @ResponseBody StudyManagementPolicy getStudyManagementPolicy(@PathVariable(ID_URL_PATH_VAR) Integer id) {
    StudyManagementPolicy foundStudyManagementPolicy = studyManagementPolicyRepository.findOne(id);

    if (foundStudyManagementPolicy == null) {
        throw new ResourceNotFoundException(id);
    }//www  .  j a va2 s  . c om
    return foundStudyManagementPolicy;
}

From source file:edu.isi.misd.scanner.network.registry.web.controller.AnalysisPolicyStatementController.java

@RequestMapping(value = ENTITY_PATH, method = { RequestMethod.GET,
        RequestMethod.HEAD }, produces = HEADER_JSON_MEDIA_TYPE)
public @ResponseBody AnalysisPolicyStatement getAnalysisPolicyStatement(
        @PathVariable(ID_URL_PATH_VAR) Integer id) {
    AnalysisPolicyStatement foundAnalysisPolicyStatement = analysisPolicyStatementRepository.findOne(id);

    if (foundAnalysisPolicyStatement == null) {
        throw new ResourceNotFoundException(id);
    }/*from   w w w  .ja v  a2  s  .c om*/
    return foundAnalysisPolicyStatement;
}

From source file:edu.isi.misd.scanner.network.registry.web.controller.AnalysisToolController.java

@RequestMapping(value = ENTITY_PATH, method = { RequestMethod.GET,
        RequestMethod.HEAD }, produces = HEADER_JSON_MEDIA_TYPE)
public @ResponseBody AnalysisTool getAnalysisTool(@PathVariable(ID_URL_PATH_VAR) Integer id) {
    AnalysisTool toolLib = analysisToolRepository.findOne(id);

    if (toolLib == null) {
        throw new ResourceNotFoundException(id);
    }//from  w  ww  .jav a  2 s .  c om
    return toolLib;
}

From source file:com.haulmont.cuba.web.controllers.StaticContentController.java

@RequestMapping(method = RequestMethod.HEAD)
public String handleHeadRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
    try {/*  w  w  w  .  j av  a2s. co m*/
        lookup(request).respondHead(request, response);
    } catch (UnsupportedOperationException e) {
        response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
    }
    return null;
}

From source file:com.thoughtworks.go.server.controller.AgentRegistrationController.java

@RequestMapping(value = "/admin/latest-agent.status", method = { RequestMethod.HEAD, RequestMethod.GET })
public void checkAgentStatus(HttpServletResponse response) {
    LOG.debug("Processing '/admin/latest-agent.status' request with values [{}:{}], [{}:{}], [{}:{}], [{}:{}]",
            SystemEnvironment.AGENT_CONTENT_MD5_HEADER, agentChecksum,
            SystemEnvironment.AGENT_LAUNCHER_CONTENT_MD5_HEADER, agentLauncherChecksum,
            SystemEnvironment.AGENT_PLUGINS_ZIP_MD5_HEADER, pluginsZip.md5(),
            SystemEnvironment.AGENT_TFS_SDK_MD5_HEADER, tfsSdkChecksum);

    response.setHeader(SystemEnvironment.AGENT_CONTENT_MD5_HEADER, agentChecksum);
    response.setHeader(SystemEnvironment.AGENT_LAUNCHER_CONTENT_MD5_HEADER, agentLauncherChecksum);
    response.setHeader(SystemEnvironment.AGENT_PLUGINS_ZIP_MD5_HEADER, pluginsZip.md5());
    response.setHeader(SystemEnvironment.AGENT_TFS_SDK_MD5_HEADER, tfsSdkChecksum);
    response.setHeader(SystemEnvironment.AGENT_EXTRA_PROPERTIES_HEADER, getAgentExtraProperties());
    setOtherHeaders(response);/*  w  w  w.j ava2s .  c o  m*/
}