Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:23:51+00:00 2026-06-18T06:23:51+00:00

I am new to google cloud storage api, as well as using servers. I’m

  • 0

I am new to google cloud storage api, as well as using servers. I’m trying to write a web application in Java using Eclipse’s IDE to read in a file that is stored in google’s cloud storage. I have the code to read in the file on the server side, and am not sure how to modify the sample code on the client side so that it supports an httpServlet instead of a RemoteServiceServlet. Any help or suggestions would be greatly appreciated!

Below is my code on the server side.

package com.google.gwt.sample.interfacecloud.server;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.channels.Channels;
import java.util.ArrayList;

import javax.servlet.http.*;
import com.google.gwt.sample.interfacecloud.client.GreetingService;

import com.google.appengine.api.files.AppEngineFile;
import com.google.appengine.api.files.FileReadChannel;
import com.google.appengine.api.files.FileService;
import com.google.appengine.api.files.FileServiceFactory;
import com.google.appengine.api.files.FileWriteChannel;
import com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder;

@SuppressWarnings("serial")
public class CloudInteraction extends HttpServlet implements GreetingService{
public static final String BUCKETNAME = "obd_data";
public static final String FILENAME = "data.txt";

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException
{
    resp.setContentType("text/plain");

    String filename = "/gs/" + BUCKETNAME + "/" + FILENAME;
    FileService fileService = FileServiceFactory.getFileService();
    AppEngineFile readableFile = new AppEngineFile(filename);
    FileReadChannel readChannel =
            fileService.openReadChannel(readableFile, false);
    BufferedReader reader = 
            new BufferedReader(Channels.newReader(readChannel, "UTF8"));
    String line = reader.readLine();
    resp.getWriter().println("READ:"+line);
    System.out.println(line);
    readChannel.close();
}

@Override
public String greetServer(String name) throws IllegalArgumentException {
    // TODO Auto-generated method stub
    return null;
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:23:53+00:00Added an answer on June 18, 2026 at 6:23 am

    You are mixing and matching RPC with plain Servlets. You should not be doing that. Do away with RPC interfaces for such interactions if you intend to you plain Servlets. You would be better served with RequestBuilder in this scenario. Note – it is not very clear what your are requirements are?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the new Google Calendar API v3. I'm trying to obtain the users
I'm building a Java application that involves Google Docs API. I'm using the old
I am trying to use new Google Cloud Messaging system but I have some
I am trying to implement new helpers for Google Cloud to Messaging . The
I am storing a file in Google App Engine using Google Cloud Storage. The
Is it possible to change the ACLs of Google Cloud Storage objects(or buckets) using
I am trying to implement google cloud messaging by using emulator. but in server
I am very new to the google cloud storage. I want to create folder
Per the answer here: Upload images/video to google cloud storage using Google App Engine
I am using the following link for using the Google Cloud Storage : Google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.