@Test public void testInitializeWithFileAndContentType() throws IOException { String contentType = "text/plain"; File file = makeTestFile(temporaryFolder.getRoot()); ParseFileHttpBody body = new ParseFileHttpBody(file, contentType); assertEquals(file.length(), body.getContentLength()); assertEquals(contentType, body.getContentType()); InputStream content = body.getContent(); byte[] contentBytes = ParseIOUtils.toByteArray(content); ParseIOUtils.closeQuietly(content); verifyTestFileContent(contentBytes); }
@Override public InputStream getContent() throws IOException { return new FileInputStream(file); }
ParseFileHttpBody extends ParseHttpBody { @Override public InputStream getContent() throws IOException { return new FileInputStream(file); } }
ParseFileHttpBody extends ParseHttpBody { @Override public InputStream getContent() throws IOException { return new FileInputStream(file); } ParseFileHttpBody(File file);  ParseFileHttpBody(File file, String contentType); }
ParseFileHttpBody extends ParseHttpBody { @Override public InputStream getContent() throws IOException { return new FileInputStream(file); } ParseFileHttpBody(File file);  ParseFileHttpBody(File file, String contentType); @Override InputStream getContent(); @Override void writeTo(OutputStream out); }
ParseFileHttpBody extends ParseHttpBody { @Override public InputStream getContent() throws IOException { return new FileInputStream(file); } ParseFileHttpBody(File file);  ParseFileHttpBody(File file, String contentType); @Override InputStream getContent(); @Override void writeTo(OutputStream out);  }