Skip to content
Permalink
Browse files
Prefer Files.write over Files.asCharSink
  • Loading branch information
gaul committed May 22, 2014
1 parent 64f7069 commit bb4a692a0581eca1029db13091885bdb91693e74
Showing 2 changed files with 2 additions and 2 deletions.
@@ -98,7 +98,7 @@ private void createObjectFromFile() throws IOException {
File tempFile = File.createTempFile(FILENAME, SUFFIX);
tempFile.deleteOnExit();

Files.asCharSink(tempFile, Charsets.UTF_8).write("Hello Cloud Files");
Files.write("Hello Cloud Files", tempFile, Charsets.UTF_8);

ObjectApi objectApi = cloudFiles.objectApiInRegionForContainer(REGION, CONTAINER_PUBLISH);

@@ -93,7 +93,7 @@ private void uploadObjectFromFile() throws IOException {
File tempFile = File.createTempFile(filename, suffix);
tempFile.deleteOnExit();

Files.asCharSink(tempFile, Charsets.UTF_8).write("uploadObjectFromFile");
Files.write("uploadObjectFromFile", tempFile, Charsets.UTF_8);

ByteSource byteSource = Files.asByteSource(tempFile);
Payload payload = Payloads.newByteSourcePayload(byteSource);

0 comments on commit bb4a692

Please sign in to comment.