Class ProviderHelper


  • @Deprecated
    public class ProviderHelper
    extends Object
    Deprecated.
    Legacy AEM 6.x API.
    Provides support methods for Provider
    • Method Detail

      • getPageSize

        public static int getPageSize​(RequestContext request,
                                      String pagesizeparam,
                                      int defaultpagesize)
        Deprecated.
      • getOffset

        public static int getOffset​(RequestContext request,
                                    String pageparam,
                                    int pageSize)
        Deprecated.
      • createErrorResponse

        public static AbstractResponseContext createErrorResponse​(org.apache.abdera.Abdera abdera,
                                                                  int code,
                                                                  String message)
        Deprecated.
        Returns an Error document based on the StreamWriter
      • createErrorResponse

        public static AbstractResponseContext createErrorResponse​(org.apache.abdera.Abdera abdera,
                                                                  int code,
                                                                  String message,
                                                                  Throwable t)
        Deprecated.
        Returns an Error document based on the StreamWriter
      • nocontent

        public static ResponseContext nocontent​(String reason)
        Deprecated.
        Return a 204 No Content response
      • returnBase

        public static ResponseContext returnBase​(org.apache.abdera.model.Base base,
                                                 int status,
                                                 Date lastModified)
        Deprecated.
        Return a document
      • sanitizeSlug

        public static String sanitizeSlug​(String slug)
        Deprecated.
        Sanitize the value of a Slug header. Any non alphanumeric characters in the slug are replaced with an underscore
      • isValidEntry

        public static boolean isValidEntry​(org.apache.abdera.model.Entry entry)
        Deprecated.
        Check to see if the entry is minimally valid according to RFC4287. This is not a complete check. It just verifies that the appropriate elements are present and that their values can be accessed.
      • checkElementNamespaces

        public static boolean checkElementNamespaces​(org.apache.abdera.model.Element element,
                                                     List<String> ignore)
        Deprecated.
        Return false if the element contains any extension elements that are not supported
      • beforeOrEqual

        public static boolean beforeOrEqual​(Date d1,
                                            Date d2)
        Deprecated.
      • resolveBase

        public static org.apache.abdera.i18n.iri.IRI resolveBase​(RequestContext request)
        Deprecated.
      • combine

        public static String combine​(String... vals)
        Deprecated.
      • getDefaultMethods

        public static String[] getDefaultMethods​(RequestContext request)
        Deprecated.
      • defaultCheckMethod

        public static boolean defaultCheckMethod​(RequestContext request,
                                                 String[] methods)
        Deprecated.
      • isAtom

        public static boolean isAtom​(RequestContext request)
        Deprecated.
      • orderByQ

        public static String[] orderByQ​(String header)
        Deprecated.

        Utility method for parsing HTTP content negotiation headers and sorting their tokens according to their q parameter values.

        e.g. Accept: audio/*; q=0.2, audio/basic, audio/mpeg; q=0.1

        would sort into:

           audio/basic
           audio/*
           audio/mpeg
         
      • getAcceptableNamedWriter

        public static org.apache.abdera.writer.NamedWriter getAcceptableNamedWriter​(org.apache.abdera.Abdera abdera,
                                                                                    String accept_header)
        Deprecated.
        Returns an appropriate NamedWriter instance given an appropriately formatted HTTP Accept header. The header will be parsed and sorted according to it's q parameter values. The first named writer capable of supporting the specified type, in order of q-value preference, will be returned. The results on this are not always predictable. For instance, if the Accept header says "application/*" it could end up with either the JSON writer or the PrettyXML writer, or any other writer that supports any writer that supports a specific form of "application/*". It's always best to be very specific in the Accept headers.
      • getNamedWriter

        public static org.apache.abdera.writer.NamedWriter getNamedWriter​(org.apache.abdera.Abdera abdera,
                                                                          String mediatype)
        Deprecated.
      • calculateEntityTag

        public static org.apache.abdera.util.EntityTag calculateEntityTag​(org.apache.abdera.model.Base base)
        Deprecated.
      • getEditUriFromEntry

        public static String getEditUriFromEntry​(org.apache.abdera.model.Entry entry)
        Deprecated.
      • getAcceptableTypes

        public static String[] getAcceptableTypes​(RequestContext request)
        Deprecated.
      • isPreferred

        public static boolean isPreferred​(String[] accepts,
                                          String s1,
                                          String s2)
        Deprecated.