public class FeedURLFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SPREADSHEETS_URL
URL of the server to connect to by default.
|
| Constructor and Description |
|---|
FeedURLFactory(String url)
Creates an URL factory targeted to a server.
|
| Modifier and Type | Method and Description |
|---|---|
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 "https://spreadsheets.google.com".
|
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.
|
public static final String DEFAULT_SPREADSHEETS_URL
public FeedURLFactory(String url) throws MalformedURLException
getDefault() instead.url - an URL used as a base for the generated URLsMalformedURLExceptionpublic static FeedURLFactory getDefault()
public URL getBaseUrl()
public URL getSpreadsheetsFeedUrl()
public URL getWorksheetFeedUrl(String spreadsheetKey, String visibility, String projection) throws MalformedURLException
getSpreadsheetKeyFromUrl(String),
or via using the My Spreadsheets feed.spreadsheetKey - a spreadsheet key, like o1123123.12312312MalformedURLExceptionpublic URL getTableFeedUrl(String spreadsheetKey) throws MalformedURLException
spreadsheetKey - key of the workbook to get the table feed from.MalformedURLExceptionpublic URL getRecordFeedUrl(String spreadsheetKey, String tableId) throws MalformedURLException
spreadsheetKey - key of the workbook to get the table feed from.tableId - id of the table to get a record feed from.MalformedURLExceptionpublic URL getListFeedUrl(String spreadsheetKey, String worksheetId, String visibility, String projection) throws MalformedURLException
getWorksheetFeedUrl(String, String, String), this requires
the spreadsheet key.
This also requires the worksheet identifier. See the
documentation on how worksheets can be identified.spreadsheetKey - a spreadsheet key, like 01123123.12312312worksheetId - a worksheet identifier or a 1-based positional indicatorMalformedURLExceptionpublic URL getCellFeedUrl(String spreadsheetKey, String worksheetId, String visibility, String projection) throws MalformedURLException
getWorksheetFeedUrl(String, String, String), this requires
the spreadsheet key.
This also requires the worksheet identifier. See the
documentation on how worksheets can be identified.spreadsheetKey - a spreadsheet key, like 01123123.12312312worksheetId - a worksheet identifier or a 1-based positional indicatorMalformedURLExceptionpublic static String getSpreadsheetKeyFromUrl(String url) throws IllegalArgumentException
url - a URL like
http://abcd.spreadsheets.google.com/ccc?id=o1231.1231.1231.1231;
if just the ID is specified, this will also workIllegalArgumentException - if the URL is not formatted correctlyCopyright © 2012. All Rights Reserved.