Merge branch 'readonly-p4-donut' into donut

This commit is contained in:
Andy Stadler 2009-05-06 17:55:44 -07:00 committed by The Android Open Source Project
commit 8cbbcb14c2

View File

@ -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 { public OutputStream getOutputStream() throws IOException {
mFile = File.createTempFile("body", null, mTempDirectory); mFile = File.createTempFile("body", null, mTempDirectory);
mFile.deleteOnExit(); mFile.deleteOnExit();