congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
HttpServletRequestImplFactory.createFromSocket
Code IndexAdd Tabnine to your IDE (free)

How to use
createFromSocket
method
in
ro.polak.http.servlet.factory.HttpServletRequestImplFactory

Best Java code snippets using ro.polak.http.servlet.factory.HttpServletRequestImplFactory.createFromSocket (Showing top 5 results out of 315)

origin: piotrpolak/android-http-server

@Test(expected = UnsupportedProtocolException.class)
public void shouldThrowUnsuportedProtocolExceptionIllegalProtocol() throws Exception {
  when(socket.getInputStream()).thenReturn(new ByteArrayInputStream("GET / MALF/1.0\r\nHeader1: someValue\r\n\r\n".getBytes()));
  factory.createFromSocket(socket);
}
origin: piotrpolak/android-http-server

  @Test
  public void shouldAssignNoCookieAndNoHeadersOnNoHeadersString() throws Exception {
    when(socket.getInputStream()).thenReturn(new ByteArrayInputStream("GET / HTTP/1.0\r\n\r\n".getBytes()));
    HttpServletRequestImpl request = factory.createFromSocket(socket);
    assertThat(request.getCookies().length, is(0));
    assertThat(request.getHeaders().keySet().size(), is(0));
  }
}
origin: piotrpolak/android-http-server

@Test(expected = ProtocolException.class)
public void shouldThrowProtocolExceptionOnMalformedHeaders() throws Exception {
  when(headersParser.parse(any(String.class))).thenThrow(new MalformedInputException("ANY"));
  factory.createFromSocket(socket);
}
origin: piotrpolak/android-http-server

@Test
public void shouldAssignNoCookieOnMalformedCookieString() throws Exception {
  headers.setHeader(Headers.HEADER_COOKIE, "ANYTHING");
  when(cookieParser.parse(any(String.class))).thenThrow(new MalformedInputException("ANY"));
  HttpServletRequestImpl request = factory.createFromSocket(socket);
  assertThat(request.getCookies().length, is(0));
  verify(cookieParser, times(1)).parse(any(String.class));
}
origin: piotrpolak/android-http-server

try {
  response = responseFactory.createFromSocket(socket);
  HttpServletRequestImpl request = requestFactory.createFromSocket(socket);
ro.polak.http.servlet.factoryHttpServletRequestImplFactorycreateFromSocket

Javadoc

Creates and returns a request out of the socket.

Popular methods of HttpServletRequestImplFactory

  • <init>
    Default constructor.
  • assignSocketMetadata
  • computeHeaders
    Reads and computes headers.
  • getCookies
  • getEndChars
  • getHeadersString
  • getImplicitServletContext
    Implicit servlet context will be overwritten when running a servlet.
  • getStatusLine
  • handlePostMultipartRequest
  • handlePostPlainRequest
  • handlePostRequest
  • isMultipartRequest
  • handlePostRequest,
  • isMultipartRequest,
  • isValidProtocol

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now