在 GAE/J 中,我需要生成 PDF 并以某种方式将其放入 ResumableGDataFileUploader 以上传到 Google Docs。我无法将数据转储到文件中,因为 GAE/J 不支持任何可以读取或写入文件的类。
有谁知道填写其余代码的好方法?
DocsService docsService = ...
Asset asset = new Asset("text/html", getHTML().getBytes(), "");
Document document = new Document(asset);
Conversion conversion = new Conversion(document, "application/pdf");
ConversionService service = ConversionServiceFactory.getConversionService();
ConversionResult result = service.convert(conversion);
for (Asset assetIter : result.getOutputDoc().getAssets()) {
byte[] data = assetIter.getData();
//How do I get the generated PDF into the ResumableGDataFileUploader?
...
ResumableGDataFileUploader.Builder builder = new ResumableGDataFileUploader.Builder(...);
}