Class RestServiceHelper


  • public class RestServiceHelper
    extends Object
    Helper class for REST services.
    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • buildDefaultResourceGetResponse

        public static <TEntity extends Serializable> javax.ws.rs.core.Response buildDefaultResourceGetResponse​(javax.servlet.http.HttpServletRequest servletRequest,
                                                                                                               javax.ws.rs.core.Request rsRequest,
                                                                                                               Supplier<TEntity> entitySupplier,
                                                                                                               BiFunction<TEntity,​Locale,​IResource> resourceConverter)
      • buildDefaultResourcePageGetResponse

        public static <TEntity extends Serializable> javax.ws.rs.core.Response buildDefaultResourcePageGetResponse​(javax.servlet.http.HttpServletRequest servletRequest,
                                                                                                                   javax.ws.rs.core.Request rsRequest,
                                                                                                                   Supplier<PagedResult<TEntity>> pagedResultSupplier,
                                                                                                                   BiFunction<PagedResult<TEntity>,​Locale,​IResourcePage<?>> resourcePageConverter)
      • buildDefaultDownloadGetResponse

        public static javax.ws.rs.core.Response buildDefaultDownloadGetResponse​(javax.servlet.http.HttpServletRequest servletRequest,
                                                                                javax.ws.rs.core.Request rsRequest,
                                                                                Supplier<ITransferableLockableEntity> fileSupplier)
      • buildDefaultZippedDownloadResponse

        public static javax.ws.rs.core.Response buildDefaultZippedDownloadResponse​(javax.servlet.http.HttpServletRequest servletRequest,
                                                                                   javax.ws.rs.core.Request rsRequest,
                                                                                   String fileName,
                                                                                   Supplier<List<? extends ITransferableLockableEntity>> filesSupplier)
      • toWebApplicationException

        public static javax.ws.rs.WebApplicationException toWebApplicationException​(Exception e,
                                                                                    String fallbackErrorMsg)