public class

FeedURLFactory

extends Object
java.lang.Object
   ↳ com.google.gdata.client.spreadsheet.FeedURLFactory

Class Overview

Provides feed URLs that can be used with a Spreadsheets server.

Summary

Constants
String BASE_PATH
String CELLS_PATH
String DEFAULT_SPREADSHEETS_URL URL of the server to connect to by default.
String LIST_PATH
String RECORD_PATH
String SPREADSHEETS_PATH
String TABLE_PATH
String WORKSHEETS_PATH
Fields
private URL baseUrl The url used as a base when creating urls.
private URL feedCells
private URL feedList
private URL feedSpreadsheets
private URL feedWorksheets
private static final FeedURLFactory instance The default FeedURLFactory instance targeted to the default URL.
Public Constructors
FeedURLFactory(String url)
Creates an URL factory targeted to a server.
Public Methods
URL getBaseUrl()
Returns the URL used as a base for the generated URLs.
URL getCellFeedUrl(String spreadsheetKey, String worksheetId, String visibility, String projection)
Creates a URL you can use to get a CellFeed, which treats the spreadsheet like spatially oriented cells.
static FeedURLFactory getDefault()
Gets the default instance of this factory, targeted to {@value #DEFAULT_SPREADSHEETS_URL}.
URL getListFeedUrl(String spreadsheetKey, String worksheetId, String visibility, String projection)
Creates a URL you can use to get a ListFeed, which treats the spreadsheet as a list of rows.
URL getRecordFeedUrl(String spreadsheetKey, String tableId)
Creates a url that you can use to get a feed of records from a table.
static String getSpreadsheetKeyFromUrl(String url)
Turns a Google Spreadsheets URL directly into the spreadsheet key.
URL getSpreadsheetsFeedUrl()
Gets a URL you can use to get a SpreadsheetFeed of all your spreadsheets.
URL getTableFeedUrl(String spreadsheetKey)
Creates a url that you can use to get a Table Feed of all the tables within a spreadsheet.
URL getWorksheetFeedUrl(String spreadsheetKey, String visibility, String projection)
Creates a URL you can use to get a WorksheetFeed of all the worksheets within a spreadsheet.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

private static final String BASE_PATH

Constant Value: "feeds/"

private static final String CELLS_PATH

Constant Value: "feeds/cells/"

public static final String DEFAULT_SPREADSHEETS_URL

URL of the server to connect to by default. Currently {@value #DEFAULT_SPREADSHEETS_URL}.

Constant Value: "https://spreadsheets.google.com"

private static final String LIST_PATH

Constant Value: "feeds/list/"

private static final String RECORD_PATH

Constant Value: "/records/"

private static final String SPREADSHEETS_PATH

Constant Value: "feeds/spreadsheets/private/full"

private static final String TABLE_PATH

Constant Value: "/tables/"

private static final String WORKSHEETS_PATH

Constant Value: "feeds/worksheets/"

Fields

private URL baseUrl

The url used as a base when creating urls.

private URL feedCells

private URL feedList

private URL feedSpreadsheets

private URL feedWorksheets

private static final FeedURLFactory instance

The default FeedURLFactory instance targeted to the default URL.

Public Constructors

public FeedURLFactory (String url)

Creates an URL factory targeted to a server. As long as you don't need to connect to a nonstandard URL, different from {@value #DEFAULT_SPREADSHEETS_URL}, you should consider calling getDefault() instead.

Parameters
url An URL used as a base for the generated URLs
Throws
MalformedURLException

Public Methods

public URL getBaseUrl ()

Returns the URL used as a base for the generated URLs.

public URL getCellFeedUrl (String spreadsheetKey, String worksheetId, String visibility, String projection)

Creates a URL you can use to get a CellFeed, which treats the spreadsheet like spatially oriented cells. Like getWorksheetFeedUrl(String, String, String), this requires the spreadsheet key. This also requires the worksheet identifier. See the documentation on how worksheets can be identified.

Parameters
spreadsheetKey A spreadsheet key, like 01123123.12312312
worksheetId A worksheet identifier or a 1-based positional indicator
visibility
projection
Throws
MalformedURLException

public static FeedURLFactory getDefault ()

Gets the default instance of this factory, targeted to {@value #DEFAULT_SPREADSHEETS_URL}.

Returns
  • the default FeedURLFactory

public URL getListFeedUrl (String spreadsheetKey, String worksheetId, String visibility, String projection)

Creates a URL you can use to get a ListFeed, which treats the spreadsheet as a list of rows. Like getWorksheetFeedUrl(String, String, String), this requires the spreadsheet key. This also requires the worksheet identifier. See the documentation on how worksheets can be identified.

Parameters
spreadsheetKey A spreadsheet key, like 01123123.12312312
worksheetId A worksheet identifier or a 1-based positional indicator
visibility
projection
Throws
MalformedURLException

public URL getRecordFeedUrl (String spreadsheetKey, String tableId)

Creates a url that you can use to get a feed of records from a table.

Parameters
spreadsheetKey Key of the workbook to get the table feed from.
tableId Id of the table to get a record feed from.
Throws
MalformedURLException

public static String getSpreadsheetKeyFromUrl (String url)

Turns a Google Spreadsheets URL directly into the spreadsheet key.

Parameters
url A URL like http://abcd.spreadsheets.google.com/ccc?id=o1231.1231.1231.1231; if just the ID is specified, this will also work
Returns
  • the spreadsheet key (o1231.1231)
Throws
IllegalArgumentException if the URL is not formatted correctly

public URL getSpreadsheetsFeedUrl ()

Gets a URL you can use to get a SpreadsheetFeed of all your spreadsheets.

public URL getTableFeedUrl (String spreadsheetKey)

Creates a url that you can use to get a Table Feed of all the tables within a spreadsheet.

Parameters
spreadsheetKey Key of the workbook to get the table feed from.
Throws
MalformedURLException

public URL getWorksheetFeedUrl (String spreadsheetKey, String visibility, String projection)

Creates a URL you can use to get a WorksheetFeed of all the worksheets within a spreadsheet. This requires the spreadsheet key, which can be obtained from the URL of the AJAX page through getSpreadsheetKeyFromUrl(String), or via using the My Spreadsheets feed.

Parameters
spreadsheetKey A spreadsheet key, like o1123123.12312312
visibility
projection
Throws
MalformedURLException