// Search Spreadsheet
FeedURLFactory urlFactory = FeedURLFactory.getDefault();
SpreadsheetQuery spreadsheetQuery =
new SpreadsheetQuery(urlFactory.getSpreadsheetsFeedUrl());
SpreadsheetFeed spreadsheetFeed = ss.query(spreadsheetQuery, SpreadsheetFeed.class);
SpreadsheetEntry spreadsheetEntry = null;
for (SpreadsheetEntry entry : spreadsheetFeed.getEntries()) {
if (ssKey.equals(entry.getKey())) {
spreadsheetEntry = entry;
logger.info("Spreadsheet:" + ssKey + " is found.");
break;
}
}
if (spreadsheetEntry == null) {
throw new RuntimeException("Cannot find spreadsheet:" + ssKey);
}
// Modify a worksheet's column size
URL worksheetFeedUrl = spreadsheetEntry.getWorksheetFeedUrl();
WorksheetFeed worksheetFeed = ss.getFeed(worksheetFeedUrl, WorksheetFeed.class);
WorksheetEntry worksheetEntry = null;
for (WorksheetEntry worksheet : worksheetFeed.getEntries()) {
if (kind.equals(worksheet.getTitle().getPlainText())) {
worksheetEntry = worksheet;