diff --git a/src/com/android/email/mail/internet/BinaryTempFileBody.java b/src/com/android/email/mail/internet/BinaryTempFileBody.java index 180011129..ce62ad8b0 100644 --- a/src/com/android/email/mail/internet/BinaryTempFileBody.java +++ b/src/com/android/email/mail/internet/BinaryTempFileBody.java @@ -56,6 +56,15 @@ public class BinaryTempFileBody implements Body { } } + /** + * An alternate way to put data into a BinaryTempFileBody is to simply supply an already- + * created file. Note that this file will be deleted after it is read. + * @param filePath The file containing the data to be stored on disk temporarily + */ + public void setFile(String filePath) { + mFile = new File(filePath); + } + public OutputStream getOutputStream() throws IOException { mFile = File.createTempFile("body", null, mTempDirectory); mFile.deleteOnExit();