当前位置: 首页>>代码示例>>Java>>正文


Java HttpURLConnection.HTTP_INTERNAL_ERROR属性代码示例

本文整理汇总了Java中java.net.HttpURLConnection.HTTP_INTERNAL_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java HttpURLConnection.HTTP_INTERNAL_ERROR属性的具体用法?Java HttpURLConnection.HTTP_INTERNAL_ERROR怎么用?Java HttpURLConnection.HTTP_INTERNAL_ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.net.HttpURLConnection的用法示例。


在下文中一共展示了HttpURLConnection.HTTP_INTERNAL_ERROR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: route

@Override
public final Opt<Response> route(final RqFallback req) throws IOException {
    return new Opt.Single<>(
        new RsWithStatus(
            new RsHtml(
                new RsVelocity(
                    TkApp.class.getResource("error.html.vm"),
                    new RsVelocity.Pair(
                        "err",
                        new TextOf(req.throwable()).asString()
                    ),
                    new RsVelocity.Pair(
                        "rev",
                        Manifests.read("Rehttp-Revision")
                    )
                )
            ),
            HttpURLConnection.HTTP_INTERNAL_ERROR
        )
    );
}
 
开发者ID:yegor256,项目名称:rehttp,代码行数:21,代码来源:TkFatal.java

示例2: readResponseHeader

private void readResponseHeader( HttpURLConnection connection ) throws IOException {
    if (!needStatusWorkaround()) {
        _responseCode = connection.getResponseCode();
        _responseMessage = connection.getResponseMessage();
    } else {
         if (connection.getHeaderField(0) == null) throw new UnknownHostException( connection.getURL().toExternalForm() );

        StringTokenizer st = new StringTokenizer( connection.getHeaderField(0) );
        st.nextToken();
        if (!st.hasMoreTokens()) {
            _responseCode = HttpURLConnection.HTTP_OK;
            _responseMessage = "OK";
        } else try {
            _responseCode = Integer.parseInt( st.nextToken() );
            _responseMessage = getRemainingTokens( st );
        } catch (NumberFormatException e) {
            _responseCode = HttpURLConnection.HTTP_INTERNAL_ERROR;
            _responseMessage = "Cannot parse response header";
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:HttpWebResponse.java

示例3: getStatus

private static int getStatus(int statusCode) {
int status = HttpUrlConnectionUtil.STATUS_ERROR; // default to -1, if status isnt 200, it would be an error
						 // anyway

switch (statusCode) {
    case HttpURLConnection.HTTP_OK:
	status = HttpUrlConnectionUtil.STATUS_OK;
	break;
    case HttpURLConnection.HTTP_INTERNAL_ERROR: // 500
	status = HttpUrlConnectionUtil.STATUS_ERROR;
	break;

    case HttpURLConnection.HTTP_NOT_FOUND: // 404
	status = HttpUrlConnectionUtil.STATUS_ERROR;
	break;
}

return status;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:HttpUrlConnectionUtil.java

示例4: updateInvoiceForm

@PUT
@Path("/{id}/invoiceform")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Update InvoiceForm", response = PaymentConfigSingleInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns InvoiceForm was updated", response = PaymentConfigSingleInputModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })

public Response updateInvoiceForm(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id,
		@BeanParam PaymentConfigSingleInputModel input);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:15,代码来源:PaymentConfigManagement.java

示例5: getEpaymentconfig

@GET
@Path("/{id}/epaymentconfig")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Get the epaymentconfig", response = PaymentConfigSingleInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns epaymentconfig of PaymentConfig", response = PaymentConfigSingleInputModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })

public Response getEpaymentconfig(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:13,代码来源:PaymentConfigManagement.java

示例6: getEpaymentProfile

@GET
@Path("/{id}/payments/{referenceUid}/epaymentprofile")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@ApiOperation(value = "get info epayment profile", response = String.class)
@ApiResponses(value = {
			@ApiResponse (code = HttpURLConnection.HTTP_OK, message = "Get info epayment profile", response = String.class),
			@ApiResponse (code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not Found", response = ExceptionModel.class),
			@ApiResponse (code = HttpURLConnection.HTTP_FORBIDDEN, message = "Accsess denied", response = ExceptionModel.class),
			@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class)})
public Response getEpaymentProfile(@Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company,
		@Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@ApiParam(value = "id of dossier", required = true) @PathParam("id") String id,
		@ApiParam (value = "referenceUid of Payment", required = true) @PathParam("referenceUid") String referenceUid);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:13,代码来源:PaymentFileManagement.java

示例7: insertDeliverables

@POST
@Path("/deliverables")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@ApiOperation(value = "Add a Deliverable", response = DeliverableInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a Deliverable was created", response = DeliverableInputModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })
public Response insertDeliverables(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @BeanParam DeliverableInputModel input);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:13,代码来源:DeliverablesManagement.java

示例8: getRollback

@GET
@Path("/{id}/rollback")
@ApiOperation(value = "rollback", response = String.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns rollback is success", response = String.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })
public Response getRollback(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") String id);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:11,代码来源:DossierActionManagement.java

示例9: addDeliverableType

@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add a Deliverabletypes", response = DeliverableTypesModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a Deliverabletypes was created", response = DeliverableTypesModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })
public Response addDeliverableType(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @BeanParam DeliverableTypeInputModel input);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:12,代码来源:DeliverableTypesManagement.java

示例10: addDossier

@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add a Dossier", response = DossierDetailModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a Dossier was created", response = DossierDetailModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })

public Response addDossier(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @BeanParam DossierInputModel input);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:13,代码来源:DossierManagement.java

示例11: getDeliverablesDetail

@GET
@Path("/deliverables/{id}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@ApiOperation(value = "Get info a Deliverable")
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns info a Deliverable "),
		@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })
public Response getDeliverablesDetail(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext, 
		@ApiParam(value = "id of Deliverable", required = true) @PathParam("id") Long id);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:13,代码来源:DeliverablesManagement.java

示例12: validateHeaders

/**
 * Examines the headers in the response and throws an exception if appropriate.
 **/
private void validateHeaders( WebResponse response ) throws HttpException {
    if (!getExceptionsThrownOnErrorStatus()) return;

    if (response.getHeaderField( "WWW-Authenticate" ) != null) {
        throw new AuthorizationRequiredException( response.getHeaderField( "WWW-Authenticate" ) );
    } else if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
        throw new HttpInternalErrorException( response.getURL() );
    } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
        throw new HttpNotFoundException( response.getResponseMessage(), response.getURL() );
    } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) {
        throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() );
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:WebClient.java

示例13: getConfig

@GET
@Path("/{id}/configs")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Get the config info of ServerConfig", response = ServerConfigSingleInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the config info of ServerConfig", response = ServerConfigSingleInputModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })

public Response getConfig(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:13,代码来源:ServerConfigManagement.java

示例14: addEpaymentconfig

@POST
@Path("/{id}/epaymentconfig")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add epaymentconfig", response = PaymentConfigSingleInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns epaymentconfig was added", response = PaymentConfigSingleInputModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })

public Response addEpaymentconfig(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id,
		@BeanParam PaymentConfigSingleInputModel input);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:15,代码来源:PaymentConfigManagement.java

示例15: validateHeaders

/**
 * Examines the headers in the response and throws an exception if appropriate.
 * @parm response - the response to validate
 **/
private void validateHeaders( WebResponse response ) throws HttpException {
    if (!getExceptionsThrownOnErrorStatus()) 
    	return;
    // see feature request [ 914314 ] Add HttpException.getResponse for better reporting
    // for possible improvements here
    if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
        throw new HttpInternalErrorException( response.getURL() );
    } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
        throw new HttpNotFoundException( response.getResponseMessage(), response.getURL() );
    } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) {
        throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() );
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:WebClient.java


注:本文中的java.net.HttpURLConnection.HTTP_INTERNAL_ERROR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。