无法解决com.google.appengine.tools.cloudstorage.GcsFilename Eclipse上的导入问题

时间:2013-08-23 15:06:58

标签: android eclipse google-app-engine google-cloud-storage

我正在尝试提供一个blob,它从GCS获取对象并提供服务。在我的servlet中,我需要导入:

导入com.google.appengine.tools.cloudstorage.GcsFileOptions;

导入com.google.appengine.tools.cloudstorage.GcsFilename

我已从此链接下载了Cloud Storage API:https://code.google.com/p/google-api-java-client/wiki/APIs#Cloud_Storage_API

但不知怎的,我无法编译我的servlet。我在这里缺少什么!! ..有谁能告诉我如何在Eclipse中的Web应用程序中添加这个库的步骤?

我需要编译的代码:

     private GcsFilename getFileName(HttpServletRequest req) {
                  String[] splits = req.getRequestURI().split("/", 4);
                  if (!splits[0].equals("") || !splits[1].equals("gcs")) {
                  throw new IllegalArgumentException("The URL is not formed as expected. " +
                  "Expecting /gcs/<bucket>/<object>");
                }
            return new GcsFilename(splits[2], splits[3]);
       }

1 个答案:

答案 0 :(得分:2)

导入不在任何这些jar文件中,但这可能有助于下载库 https://developers.google.com/appengine/docs/java/googlecloudstorageclient/migrate