1

为了帮助开发,我想从 appengine 开发服务器启动一些需要访问文件系统、执行环境等的程序。本质上,我想写:

if (SystemProperty.environment.value().equals(
        SystemProperty.Environment.Value.Development)) {

    doStuffICannotDoOnRealAppengineButShouldBeABleToDoOnMyMachine();

}

这可能吗?

我的目标是预览 AppEngine 正在发送的电子邮件。现在我可以将内容打印到 System.out,但我想将它们保存到文件并启动浏览器,以便我的设计人员可以立即看到电子邮件内容。

4

1 回答 1

0

Hrm. I see a number of ways of accomplishing this without having to get around GAEs file system restrictions.

  • You could provide some debug call with an email address request param which would send the particular email via Google's email API to the address specified. You'd probably want to see it "rendered" by the email client anyway.
  • You could store the file using Google's cloud storage API. This should allow you to put a file that can be displayed via an URL. If you can't using that API then you certainly can using S3's.
  • You could make some HTTP post request to a local server using Google's URL fetch API. You could even do it to localhost port 8100 (or whatever) and then run netcat to receive the email nc -l 8100.

Hope something here helps.

于 2012-09-30T18:38:40.703 回答