@Test public void streamIsFileItemStream() throws Exception { FileItem item = newMock(FileItem.class); InputStream stream = new NullInputStream(3); UploadedFileItem uploadedFile = new UploadedFileItem(item); expect(item.getInputStream()).andReturn(stream); replay(); assertSame(uploadedFile.getStream(), stream); verify(); }
@Override public InputStream getStream() { try { return item.getInputStream(); } catch (IOException e) { throw new RuntimeException(UploadMessages.unableToOpenContentFile(this), e); } }
UploadedFileItem implements UploadedFile { @Override public InputStream getStream() { try { return item.getInputStream(); } catch (IOException e) { throw new RuntimeException(UploadMessages.unableToOpenContentFile(this), e); } } }
UploadedFileItem implements UploadedFile { @Override public InputStream getStream() { try { return item.getInputStream(); } catch (IOException e) { throw new RuntimeException(UploadMessages.unableToOpenContentFile(this), e); } } UploadedFileItem(FileItem item); }
UploadedFileItem implements UploadedFile { @Override public InputStream getStream() { try { return item.getInputStream(); } catch (IOException e) { throw new RuntimeException(UploadMessages.unableToOpenContentFile(this), e); } } UploadedFileItem(FileItem item); @Override String getContentType(); @Override String getFileName(); @Override String getFilePath(); @Override long getSize(); @Override InputStream getStream(); @Override boolean isInMemory(); @Override void write(File file); void cleanup(); }
UploadedFileItem implements UploadedFile { @Override public InputStream getStream() { try { return item.getInputStream(); } catch (IOException e) { throw new RuntimeException(UploadMessages.unableToOpenContentFile(this), e); } } UploadedFileItem(FileItem item); @Override String getContentType(); @Override String getFileName(); @Override String getFilePath(); @Override long getSize(); @Override InputStream getStream(); @Override boolean isInMemory(); @Override void write(File file); void cleanup();  }