Google Data APIs Client Library (1.41.1)



com.google.gdata.client.spreadsheet
Class FeedURLFactory

java.lang.Object
  extended by com.google.gdata.client.spreadsheet.FeedURLFactory

public class FeedURLFactory
extends java.lang.Object

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


Field Summary
static java.lang.String DEFAULT_SPREADSHEETS_URL
          URL of the server to connect to by default.
 
Constructor Summary
FeedURLFactory(java.lang.String url)
          Creates an URL factory targeted to a server.
 
Method Summary
 java.net.URL getBaseUrl()
          Returns the URL used as a base for the generated URLs.
 java.net.URL getCellFeedUrl(java.lang.String spreadsheetKey, java.lang.String worksheetId, java.lang.String visibility, java.lang.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 "http://spreadsheets.google.com".
 java.net.URL getListFeedUrl(java.lang.String spreadsheetKey, java.lang.String worksheetId, java.lang.String visibility, java.lang.String projection)
          Creates a URL you can use to get a ListFeed, which treats the spreadsheet as a list of rows.
 java.net.URL getRecordFeedUrl(java.lang.String spreadsheetKey, java.lang.String tableId)
          Creates a url that you can use to get a feed of records from a table.
static java.lang.String getSpreadsheetKeyFromUrl(java.lang.String url)
          Turns a Google Spreadsheets URL directly into the spreadsheet key.
 java.net.URL getSpreadsheetsFeedUrl()
          Gets a URL you can use to get a SpreadsheetFeed of all your spreadsheets.
 java.net.URL getTableFeedUrl(java.lang.String spreadsheetKey)
          Creates a url that you can use to get a Table Feed of all the tables within a spreadsheet.
 java.net.URL getWorksheetFeedUrl(java.lang.String spreadsheetKey, java.lang.String visibility, java.lang.String projection)
          Creates a URL you can use to get a WorksheetFeed of all the worksheets within a spreadsheet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SPREADSHEETS_URL

public static final java.lang.String DEFAULT_SPREADSHEETS_URL
URL of the server to connect to by default. Currently "http://spreadsheets.google.com".

See Also:
Constant Field Values
Constructor Detail

FeedURLFactory

public FeedURLFactory(java.lang.String url)
               throws java.net.MalformedURLException
Creates an URL factory targeted to a server. As long as you don't need to connect to a nonstandard URL, different from "http://spreadsheets.google.com", you should consider calling getDefault() instead.

Parameters:
url - an URL used as a base for the generated URLs
Throws:
java.net.MalformedURLException
Method Detail

getDefault

public static FeedURLFactory getDefault()
Gets the default instance of this factory, targeted to "http://spreadsheets.google.com".

Returns:
the default FeedURLFactory

getBaseUrl

public java.net.URL getBaseUrl()
Returns the URL used as a base for the generated URLs.


getSpreadsheetsFeedUrl

public java.net.URL getSpreadsheetsFeedUrl()
Gets a URL you can use to get a SpreadsheetFeed of all your spreadsheets.


getWorksheetFeedUrl

public java.net.URL getWorksheetFeedUrl(java.lang.String spreadsheetKey,
                                        java.lang.String visibility,
                                        java.lang.String projection)
                                 throws java.net.MalformedURLException
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
Throws:
java.net.MalformedURLException

getTableFeedUrl

public java.net.URL getTableFeedUrl(java.lang.String spreadsheetKey)
                             throws java.net.MalformedURLException
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:
java.net.MalformedURLException

getRecordFeedUrl

public java.net.URL getRecordFeedUrl(java.lang.String spreadsheetKey,
                                     java.lang.String tableId)
                              throws java.net.MalformedURLException
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:
java.net.MalformedURLException

getListFeedUrl

public java.net.URL getListFeedUrl(java.lang.String spreadsheetKey,
                                   java.lang.String worksheetId,
                                   java.lang.String visibility,
                                   java.lang.String projection)
                            throws java.net.MalformedURLException
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
Throws:
java.net.MalformedURLException

getCellFeedUrl

public java.net.URL getCellFeedUrl(java.lang.String spreadsheetKey,
                                   java.lang.String worksheetId,
                                   java.lang.String visibility,
                                   java.lang.String projection)
                            throws java.net.MalformedURLException
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
Throws:
java.net.MalformedURLException

getSpreadsheetKeyFromUrl

public static java.lang.String getSpreadsheetKeyFromUrl(java.lang.String url)
                                                 throws java.lang.IllegalArgumentException
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:
java.lang.IllegalArgumentException - if the URL is not formatted correctly