Examples of closeFinally()


Examples of com.google.appengine.api.files.FileWriteChannel.closeFinally()

    private void writeToFile(AppEngineFile file, String content) throws IOException {
        FileWriteChannel channel = service.openWriteChannel(file, true);
        try {
            channel.write(ByteBuffer.wrap(content.getBytes()));
        } finally {
            channel.closeFinally();
        }
    }

}
View Full Code Here

Examples of com.google.appengine.api.files.FileWriteChannel.closeFinally()

        AppEngineFile file = fileService.createNewBlobFile("text/plain", "uploadedText.txt");
        FileWriteChannel channel = fileService.openWriteChannel(file, true);
        try {
            channel.write(ByteBuffer.wrap(text.getBytes()));
        } finally {
            channel.closeFinally();
        }
        return fileService.getBlobKey(file);
    }
}
View Full Code Here

Examples of com.google.appengine.api.files.FileWriteChannel.closeFinally()

        try {
            try (ReadableByteChannel in = Channels.newChannel(getImageStream("capedwarf.png"))) {
                copy(in, channel);
            }
        } finally {
            channel.closeFinally();
        }

        blobKey = fileService.getBlobKey(file);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.