Class FormFieldRequestParameter

  • All Implemented Interfaces:
    RequestParameter

    public class FormFieldRequestParameter
    extends java.lang.Object
    implements RequestParameter
    Created with IntelliJ IDEA. User: syr Date: 1/20/14 Time: 12:52 PM To change this template use File | Settings | File Templates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] get()
      Returns the contents of the parameter as an array of bytes.
      java.lang.String getContentType()
      Returns the content type passed by the browser or null if not defined.
      java.lang.String getFileName()
      Returns the original filename in the client's filesystem, as provided by the browser (or other client software).
      java.io.InputStream getInputStream()
      Returns an InputStream that can be used to retrieve the contents of the file.
      java.lang.String getName()  
      long getSize()
      Returns the size in bytes of the parameter.
      java.lang.String getString()
      Returns the contents of the parameter as a String, using the default character encoding.
      java.lang.String getString​(java.lang.String encoding)
      Returns the contents of the parameter as a String, using the specified encoding.
      boolean isFormField()
      Determines whether or not this instance represents a simple form field or an uploaded file.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FormFieldRequestParameter

        public FormFieldRequestParameter​(java.lang.String parameterValue)
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
        Description copied from interface: RequestParameter
        Returns an InputStream that can be used to retrieve the contents of the file.

        Each call to this method returns a new InputStream to the request parameter data. Make sure to close the stream to prevent leaking resources.

        Specified by:
        getInputStream in interface RequestParameter
        Returns:
        An InputStream that can be used to retrieve the contents of the file.
      • getFileName

        public java.lang.String getFileName()
        Description copied from interface: RequestParameter
        Returns the original filename in the client's filesystem, as provided by the browser (or other client software). In most cases, this will be the base file name, without path information. However, some clients, such as the Opera browser, do include path information.
        Specified by:
        getFileName in interface RequestParameter
        Returns:
        The original filename in the client's filesystem.
      • isFormField

        public boolean isFormField()
        Description copied from interface: RequestParameter
        Determines whether or not this instance represents a simple form field or an uploaded file.
        Specified by:
        isFormField in interface RequestParameter
        Returns:
        true if the instance represents a simple form field; false if it represents an uploaded file.
      • getContentType

        public java.lang.String getContentType()
        Description copied from interface: RequestParameter
        Returns the content type passed by the browser or null if not defined.
        Specified by:
        getContentType in interface RequestParameter
        Returns:
        The content type passed by the browser or null if not defined.
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface RequestParameter
        Returns:
        the name of this RequestParameter
      • get

        public byte[] get()
        Description copied from interface: RequestParameter
        Returns the contents of the parameter as an array of bytes.
        Specified by:
        get in interface RequestParameter
        Returns:
        The contents of the parameter as an array of bytes.
      • getString

        public java.lang.String getString()
        Description copied from interface: RequestParameter
        Returns the contents of the parameter as a String, using the default character encoding. This method uses RequestParameter.get() to retrieve the contents of the item.
        Specified by:
        getString in interface RequestParameter
        Returns:
        The contents of the parameter, as a string.
      • getString

        public java.lang.String getString​(java.lang.String encoding)
        Description copied from interface: RequestParameter
        Returns the contents of the parameter as a String, using the specified encoding. This method uses link RequestParameter.get() to retrieve the contents of the item.
        Specified by:
        getString in interface RequestParameter
        Parameters:
        encoding - The character encoding to use.
        Returns:
        The contents of the parameter, as a string.
      • getSize

        public long getSize()
        Description copied from interface: RequestParameter
        Returns the size in bytes of the parameter.
        Specified by:
        getSize in interface RequestParameter
        Returns:
        The size in bytes of the parameter.