public class FeedURLFactory
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SPREADSHEETS_URL
URL of the server to connect to by default.
|
| Constructor and Description |
|---|
FeedURLFactory(java.lang.String url)
Creates an URL factory targeted to a server.
|
| Modifier and Type | Method and Description |
|---|---|
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 "https://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.
|
public static final java.lang.String DEFAULT_SPREADSHEETS_URL
public FeedURLFactory(java.lang.String url)
throws java.net.MalformedURLException
getDefault() instead.url - an URL used as a base for the generated URLsjava.net.MalformedURLExceptionpublic static FeedURLFactory getDefault()
public java.net.URL getBaseUrl()
public java.net.URL getSpreadsheetsFeedUrl()
public java.net.URL getWorksheetFeedUrl(java.lang.String spreadsheetKey,
java.lang.String visibility,
java.lang.String projection)
throws java.net.MalformedURLException
getSpreadsheetKeyFromUrl(String),
or via using the My Spreadsheets feed.spreadsheetKey - a spreadsheet key, like o1123123.12312312java.net.MalformedURLExceptionpublic java.net.URL getTableFeedUrl(java.lang.String spreadsheetKey)
throws java.net.MalformedURLException
spreadsheetKey - key of the workbook to get the table feed from.java.net.MalformedURLExceptionpublic java.net.URL getRecordFeedUrl(java.lang.String spreadsheetKey,
java.lang.String tableId)
throws java.net.MalformedURLException
spreadsheetKey - key of the workbook to get the table feed from.tableId - id of the table to get a record feed from.java.net.MalformedURLExceptionpublic java.net.URL getListFeedUrl(java.lang.String spreadsheetKey,
java.lang.String worksheetId,
java.lang.String visibility,
java.lang.String projection)
throws java.net.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 indicatorjava.net.MalformedURLExceptionpublic java.net.URL getCellFeedUrl(java.lang.String spreadsheetKey,
java.lang.String worksheetId,
java.lang.String visibility,
java.lang.String projection)
throws java.net.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 indicatorjava.net.MalformedURLExceptionpublic static java.lang.String getSpreadsheetKeyFromUrl(java.lang.String url)
throws java.lang.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 workjava.lang.IllegalArgumentException - if the URL is not formatted correctly