test_class.declarator: httpServletRequest
test_class.modifier: private
test_class.original_string: private HttpServletRequest              httpServletRequest;
test_class.type: HttpServletRequest
test_class.var_name: httpServletRequest
test_class.declarator: formDataEntityProvider
test_class.modifier: private
test_class.original_string: private MultipartFormDataEntityProvider formDataEntityProvider;
test_class.type: MultipartFormDataEntityProvider
test_class.var_name: formDataEntityProvider
test_class.file: everrest-core/src/test/java/org/everrest/core/impl/provider/MultipartFormDataEntityProviderTest.java
test_class.identifier: MultipartFormDataEntityProviderTest
test_case.body: @Test
      public void readsEntityStreamAsIteratorOfFileItems() throws Exception {
          Class type = Iterator.class;
          ParameterizedType genericType = newParameterizedType(Iterator.class, FileItem.class);
          Annotation[] annotations = new Annotation[0];
          MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
          InputStream in = mock(InputStream.class);
  
          mockHttpServletRequest();
  
          Iterator<FileItem> fileItems = formDataEntityProvider.readFrom(type, genericType, annotations, null, headers, in);
          List<FileItem> fileItemList = Lists.newArrayList(fileItems);
          assertEquals(1, fileItemList.size());
          assertEquals("text", fileItemList.get(0).getFieldName());
          assertEquals("test.txt", fileItemList.get(0).getName());
          assertEquals("text/plain", fileItemList.get(0).getContentType());
          assertEquals("hello", fileItemList.get(0).getString());
      }
test_case.class_method_signature: MultipartFormDataEntityProviderTest.readsEntityStreamAsIteratorOfFileItems()
test_case.full_signature: @Test public void readsEntityStreamAsIteratorOfFileItems()
test_case.identifier: readsEntityStreamAsIteratorOfFileItems
test_case.invocations: newParameterizedType mock mockHttpServletRequest readFrom newArrayList assertEquals size assertEquals getFieldName get assertEquals getName get assertEquals getContentType get assertEquals getString get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void readsEntityStreamAsIteratorOfFileItems()
focal_class.declarator: httpRequest
focal_class.modifier: protected
focal_class.original_string: protected HttpServletRequest httpRequest;
focal_class.type: HttpServletRequest
focal_class.var_name: httpRequest
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/provider/MultipartFormDataEntityProvider.java
focal_class.identifier: MultipartFormDataEntityProvider
focal_class.interfaces: implements EntityProvider<Iterator<FileItem>>
focal_class.class_method_signature: MultipartFormDataEntityProvider.MultipartFormDataEntityProvider(@Context HttpServletRequest httpRequest)
focal_class.full_signature: public  MultipartFormDataEntityProvider(@Context HttpServletRequest httpRequest)
focal_class.identifier: MultipartFormDataEntityProvider
focal_class.modifiers: public
focal_class.parameters: (@Context HttpServletRequest httpRequest)
focal_class.signature:  MultipartFormDataEntityProvider(@Context HttpServletRequest httpRequest)
focal_class.class_method_signature: MultipartFormDataEntityProvider.isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.full_signature: @Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.identifier: isReadable
focal_class.modifiers: @Override public
focal_class.parameters: (Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.return: boolean
focal_class.signature: boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.class_method_signature: MultipartFormDataEntityProvider.readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_class.full_signature: @Override @SuppressWarnings("unchecked") public Iterator<FileItem> readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_class.identifier: readFrom
focal_class.modifiers: @Override @SuppressWarnings("unchecked") public
focal_class.parameters: (Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_class.return: Iterator<FileItem>
focal_class.signature: Iterator<FileItem> readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_class.class_method_signature: MultipartFormDataEntityProvider.getSize(Iterator<FileItem> t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.full_signature: @Override public long getSize(Iterator<FileItem> t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.identifier: getSize
focal_class.modifiers: @Override public
focal_class.parameters: (Iterator<FileItem> t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.return: long
focal_class.signature: long getSize(Iterator<FileItem> t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.class_method_signature: MultipartFormDataEntityProvider.isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.full_signature: @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.identifier: isWriteable
focal_class.modifiers: @Override public
focal_class.parameters: (Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.return: boolean
focal_class.signature: boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.class_method_signature: MultipartFormDataEntityProvider.writeTo(Iterator<FileItem> t,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.full_signature: @Override public void writeTo(Iterator<FileItem> t,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.identifier: writeTo
focal_class.modifiers: @Override public
focal_class.parameters: (Iterator<FileItem> t,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.return: void
focal_class.signature: void writeTo(Iterator<FileItem> t,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_method.body: @Override
      @SuppressWarnings("unchecked")
      public Iterator<FileItem> readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream) throws IOException {
          try {
              ApplicationContext context = ApplicationContext.getCurrent();
              int bufferSize = context.getEverrestConfiguration().getMaxBufferSize();
              DefaultFileItemFactory factory = new DefaultFileItemFactory(bufferSize, FileCollector.getInstance().getStore());
              FileUpload upload = new FileUpload(factory);
              return upload.parseRequest(httpRequest).iterator();
          } catch (FileUploadException e) {
              throw new IOException(String.format("Can't process multipart data item, %s", e));
          }
      }
focal_method.class_method_signature: MultipartFormDataEntityProvider.readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_method.full_signature: @Override @SuppressWarnings("unchecked") public Iterator<FileItem> readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_method.identifier: readFrom
focal_method.invocations: getCurrent getMaxBufferSize getEverrestConfiguration getStore getInstance iterator parseRequest format
focal_method.modifiers: @Override @SuppressWarnings("unchecked") public
focal_method.parameters: (Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)
focal_method.return: Iterator<FileItem>
focal_method.signature: Iterator<FileItem> readFrom(Class<Iterator<FileItem>> type,
                                         Type genericType,
                                         Annotation[] annotations,
                                         MediaType mediaType,
                                         MultivaluedMap<String, String> httpHeaders,
                                         InputStream entityStream)