Class Request

java.lang.Object
ch.software_atelier.simpleflex.Request

public class Request extends Object
Holds a request with all contents sent by a WebBrowser.
  • Field Details

  • Constructor Details

    • Request

      public Request()
  • Method Details

    • addHeaderLine

      protected boolean addHeaderLine(String line)
      Adds a Header-Object to the Request-Object.
      Parameters:
      line - The Headerline given by the Client
      Returns:
      sucessfully added? yes/no
    • setSecure

      public void setSecure(boolean secure)
      Parameters:
      secure -
    • setClient

      public void setClient(InetAddress client)
      Parameters:
      client -
    • setProtocoll

      public void setProtocoll(String protocoll)
      Parameters:
      protocoll -
    • setMethod

      public void setMethod(String method)
      Parameters:
      method -
    • setRequestString

      public void setRequestString(String requestString)
      Parameters:
      requestString -
    • arguments

      public RequestArgument[] arguments()
      Returns:
    • getArgument

      public String getArgument(String key)
      Parameters:
      key -
      Returns:
    • getProtocoll

      public String getProtocoll()
      Returns the version of the used protocol. Example: HTTP/1.0
    • getMethod

      public String getMethod()
      This method returns GET or POST
      Returns:
    • getReqestString

      public String getReqestString()
      Returns the Request-String. It is a Path to a File.
      Returns:
      a path to a File like /index.htm or /something/abc.mpg
    • getLastRequestStringComponent

      public String getLastRequestStringComponent()
      Returns:
    • getHeaders

      public HashMap<String,String> getHeaders()
      Returns:
    • getHeaderValue

      public String getHeaderValue(String key)
      Parameters:
      key -
      Returns:
    • isSecureConnection

      public boolean isSecureConnection()
      Returns true, if the connnection is secure. (HTTPS)
      Returns:
    • getHost

      public String getHost()
      Returns:
    • getPort

      public int getPort()
      Returns:
    • getClient

      public InetAddress getClient()
      Returns an InetAddress-Object that holds the IP-Address of the Client
      Returns:
    • appendSinglePart

      public void appendSinglePart(BufferedInputStream bis, long length) throws IOException
      Throws:
      IOException
    • apendMultipart

      public void apendMultipart(BufferedInputStream bis, long length) throws IOException
      Parameters:
      bis -
      Throws:
      IOException
    • apendURLEncoded

      public void apendURLEncoded(BufferedInputStream bfis, long length) throws IOException
      Parameters:
      bfis -
      length -
      Throws:
      IOException
    • apendJSON

      public void apendJSON(BufferedInputStream bfis, String charset, long length) throws IOException
      Parameters:
      bfis -
      charset -
      length -
      Throws:
      IOException
    • apendJSONArray

      public void apendJSONArray(BufferedInputStream bfis, String charset, long length) throws IOException
      Parameters:
      bfis -
      charset -
      length -
      Throws:
      IOException
    • apendXML

      public void apendXML(BufferedInputStream bfis, String charset, long length) throws IOException
      Parameters:
      bfis -
      charset -
      length -
      Throws:
      IOException
    • getRecievedData

      public RecievedData[] getRecievedData()
      Returns:
    • getRecievedText

      public RecievedText getRecievedText(String field)
      Parameters:
      field -
      Returns:
    • getRecievedFile

      public RecievedFile getRecievedFile(String field)
      Parameters:
      field -
      Returns:
    • isJSONReq

      public boolean isJSONReq()
      Returns:
    • getJSONReq

      public org.json.JSONObject getJSONReq()
      Returns:
    • isJSONArrReq

      public boolean isJSONArrReq()
      Returns:
    • getJSONArrReq

      public org.json.JSONArray getJSONArrReq()
      Returns:
    • isXMLReq

      public boolean isXMLReq()
      Returns:
    • getXMLReq

      public xmlwise.XmlElement getXMLReq()
      Returns:
    • isFormPostReq

      public boolean isFormPostReq()
      Returns:
    • isSinglePartReq

      public boolean isSinglePartReq()
      Returns:
    • getRawData

      public byte[] getRawData()
      Returns:
    • getSinglePartFilename

      public String getSinglePartFilename()
      Returns:
    • getSinglePartMimeType

      public String getSinglePartMimeType()
      Returns:
    • getSinglePartFile

      public File getSinglePartFile()
      Returns:
    • getBoundary

      public String getBoundary()
      Returns:
    • cleanup

      public void cleanup()