Class FormFields

java.lang.Object
java.util.concurrent.CompletableFuture<org.eclipse.jetty.util.Fields>
org.eclipse.jetty.io.content.ContentSourceCompletableFuture<org.eclipse.jetty.util.Fields>
org.eclipse.jetty.server.FormFields
All Implemented Interfaces:
CompletionStage<org.eclipse.jetty.util.Fields>, Future<org.eclipse.jetty.util.Fields>

public class FormFields extends org.eclipse.jetty.io.content.ContentSourceCompletableFuture<org.eclipse.jetty.util.Fields>
A CompletableFuture that is completed once a application/x-www-form-urlencoded content has been parsed asynchronously from the Content.Source.
  • Field Details

  • Method Details

    • getFormEncodedCharset

      public static Charset getFormEncodedCharset(Request request)
    • set

      public static void set(Request request, CompletableFuture<org.eclipse.jetty.util.Fields> fields)
      Set a Fields or related failure for the request
      Parameters:
      request - The request to which to associate the fields with
      fields - A CompletableFuture that will provide either the fields or a failure.
    • get

      public static CompletableFuture<org.eclipse.jetty.util.Fields> get(Request request)
      Parameters:
      request - The request to enquire from
      Returns:
      A CompletableFuture that will provide either the fields or a failure, or null if none set.
      See Also:
    • from

      public static CompletableFuture<org.eclipse.jetty.util.Fields> from(Request request)
      Find or create a FormFields from a Content.Source.
      Parameters:
      request - The Request in which to look for an existing FormFields attribute, using the classname as the attribute name, else the request is used as a Content.Source from which to read the fields and set the attribute.
      Returns:
      A CompletableFuture that will provide the Fields or a failure.
      See Also:
      • from(Content.Source, Attributes, Charset, int, int)
    • from

      public static CompletableFuture<org.eclipse.jetty.util.Fields> from(Request request, Charset charset)
      Find or create a FormFields from a Content.Source.
      Parameters:
      request - The Request in which to look for an existing FormFields attribute, using the classname as the attribute name, else the request is used as a Content.Source from which to read the fields and set the attribute.
      charset - the Charset to use for byte to string conversion.
      Returns:
      A CompletableFuture that will provide the Fields or a failure.
      See Also:
      • from(Content.Source, Attributes, Charset, int, int)
    • from

      public static CompletableFuture<org.eclipse.jetty.util.Fields> from(Request request, int maxFields, int maxLength)
      Find or create a FormFields from a Content.Source.
      Parameters:
      request - The Request in which to look for an existing FormFields attribute, using the classname as the attribute name, else the request is used as a Content.Source from which to read the fields and set the attribute.
      maxFields - The maximum number of fields to be parsed
      maxLength - The maximum total size of the fields
      Returns:
      A CompletableFuture that will provide the Fields or a failure.
      See Also:
      • from(Content.Source, Attributes, Charset, int, int)
    • from

      public static CompletableFuture<org.eclipse.jetty.util.Fields> from(Request request, Charset charset, int maxFields, int maxLength)
      Find or create a FormFields from a Content.Source.
      Parameters:
      request - The Request in which to look for an existing FormFields attribute, using the classname as the attribute name, else the request is used as a Content.Source from which to read the fields and set the attribute.
      charset - the Charset to use for byte to string conversion.
      maxFields - The maximum number of fields to be parsed
      maxLength - The maximum total size of the fields
      Returns:
      A CompletableFuture that will provide the Fields or a failure.
      See Also:
      • from(Content.Source, Attributes, Charset, int, int)
    • parse

      protected org.eclipse.jetty.util.Fields parse(org.eclipse.jetty.io.Content.Chunk chunk) throws CharacterCodingException
      Specified by:
      parse in class org.eclipse.jetty.io.content.ContentSourceCompletableFuture<org.eclipse.jetty.util.Fields>
      Throws:
      CharacterCodingException