Search in sources :

Example 1 with MultipartConfig

use of org.apache.felix.http.base.internal.dispatch.MultipartConfig in project felix by apache.

the class ServletDTOBuilder method build.

/**
 * Build a servlet DTO from a servlet info
 * @param info The servlet info
 * @return A servlet DTO
 */
public static ServletDTO build(final ServletInfo info, final int reason) {
    final ServletDTO dto = (reason != -1 ? new FailedServletDTO() : new ServletDTO());
    BaseServletDTOBuilder.fill(dto, info);
    if (reason != -1) {
        ((FailedServletDTO) dto).failureReason = reason;
    }
    dto.patterns = BuilderConstants.EMPTY_STRING_ARRAY;
    final MultipartConfig config = info.getMultipartConfig();
    dto.multipartEnabled = config != null;
    if (config != null) {
        dto.multipartFileSizeThreshold = config.multipartThreshold;
        dto.multipartLocation = config.multipartLocation;
        dto.multipartMaxFileSize = config.multipartMaxFileSize;
        dto.multipartMaxRequestSize = config.multipartMaxRequestSize;
    }
    return dto;
}
Also used : FailedServletDTO(org.osgi.service.http.runtime.dto.FailedServletDTO) MultipartConfig(org.apache.felix.http.base.internal.dispatch.MultipartConfig) FailedServletDTO(org.osgi.service.http.runtime.dto.FailedServletDTO) ServletDTO(org.osgi.service.http.runtime.dto.ServletDTO)

Aggregations

MultipartConfig (org.apache.felix.http.base.internal.dispatch.MultipartConfig)1 FailedServletDTO (org.osgi.service.http.runtime.dto.FailedServletDTO)1 ServletDTO (org.osgi.service.http.runtime.dto.ServletDTO)1