@Test public void shouldReturnActualExtraHeader() { String filename = "justfortest.txt"; String path = "/hello/world/" + filename; File newFile = new File(path); FilePart part = new FilePart(newFile); String expected = "filename=\"" + filename +"\""; String result = new String(part.getExtraHeader()); assertThat(result, is(expected)); }
@Override protected byte[] getExtraHeader() { return ("filename=\"" + filename + "\"").getBytes(); }
FilePart extends AbstractPart { @Override protected byte[] getExtraHeader() { return ("filename=\"" + filename + "\"").getBytes(); } }
FilePart extends AbstractPart { @Override protected byte[] getExtraHeader() { return ("filename=\"" + filename + "\"").getBytes(); } FilePart(File file);  FilePart(String name, File file);  FilePart(String name, File file, ContentType contentType); }
FilePart extends AbstractPart { @Override protected byte[] getExtraHeader() { return ("filename=\"" + filename + "\"").getBytes(); } FilePart(File file);  FilePart(String name, File file);  FilePart(String name, File file, ContentType contentType); @Override ContentType getContentType(); @Override InputStream getContent(); String getFilename(); }
FilePart extends AbstractPart { @Override protected byte[] getExtraHeader() { return ("filename=\"" + filename + "\"").getBytes(); } FilePart(File file);  FilePart(String name, File file);  FilePart(String name, File file, ContentType contentType); @Override ContentType getContentType(); @Override InputStream getContent(); String getFilename();  }