谷歌应用引擎不支持 FileOutputStream [英] google appengine not supporting FileOutputStream
问题描述
我正在尝试写入 Google Appengine 中的文件,但它给出错误消息 java.io.FileOutputStream is not supported by Google App Engine's Java runtime environment
I am trying to write to a file in Google appengine but it giving a error message java.io.FileOutputStream is not supported by Google App Engine's Java runtime environment
即使我导入了
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
推荐答案
好吧,这不是 Java 编译器错误.此类是 Google App Engine 中的受限 API,您不得使用它.
Well it's not a java compiler error. This class is a restricted API in Google App Engine you are not allowed to use it.
在此处阅读有关 GAE Java 运行时环境和限制的信息:http://code.google.com/appengine/docs/java/runtime.html
Read about the GAE Java Runtime Environment and restrictions here: http://code.google.com/appengine/docs/java/runtime.html
最接近 GAE 文件存储的是 Blobstore API:http://code.google.com/appengine/docs/java/blobstore/
The closest you will get to file storage on GAE is the Blobstore API: http://code.google.com/appengine/docs/java/blobstore/
如果您需要在代码中创建文件 GAE 不是适合您的平台.
If you need to create files in code GAE is not an appropriate platform for you.
这篇关于谷歌应用引擎不支持 FileOutputStream的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!