當前位置: 首頁>>代碼示例>>Java>>正文


Java SpreadsheetQuery類代碼示例

本文整理匯總了Java中com.google.gdata.client.spreadsheet.SpreadsheetQuery的典型用法代碼示例。如果您正苦於以下問題:Java SpreadsheetQuery類的具體用法?Java SpreadsheetQuery怎麽用?Java SpreadsheetQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SpreadsheetQuery類屬於com.google.gdata.client.spreadsheet包,在下文中一共展示了SpreadsheetQuery類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSpreadsheet

import com.google.gdata.client.spreadsheet.SpreadsheetQuery; //導入依賴的package包/類
/**
 * Gets the SpreadsheetEntry for the first spreadsheet with that name
 * retrieved in the feed.
 *
 * @param spreadsheet the name of the spreadsheet
 * @return the first SpreadsheetEntry in the returned feed, so latest
 * spreadsheet with the specified name
 * @throws Exception if error is encountered, such as no spreadsheets with the
 * name
 */
public SpreadsheetEntry getSpreadsheet(String spreadsheet)
    throws Exception {
  
    SpreadsheetQuery spreadsheetQuery 
      = new SpreadsheetQuery(factory.getSpreadsheetsFeedUrl());
    spreadsheetQuery.setTitleQuery(spreadsheet);
    SpreadsheetFeed spreadsheetFeed = service.query(spreadsheetQuery, 
        SpreadsheetFeed.class);
    List<SpreadsheetEntry> spreadsheets = spreadsheetFeed.getEntries();
    if (spreadsheets.isEmpty()) {
      throw new Exception("No spreadsheets with that name");
    }

    return spreadsheets.get(0);
}
 
開發者ID:google,項目名稱:gdata-java-client,代碼行數:26,代碼來源:ImportClient.java

示例2: getSpreadsheetFeedQuery

import com.google.gdata.client.spreadsheet.SpreadsheetQuery; //導入依賴的package包/類
private BaseFeed<?, ?> getSpreadsheetFeedQuery(SpreadsheetQuery squery, Class<? extends BaseFeed<?, ?>> feedClass) {
	try { 
		return service.getFeed(squery, feedClass);
	} catch (Exception ex) {
		try {
			Thread.sleep(RETRY_DELAY);
		} catch (InterruptedException e) {
		}
		// Try to relogin
		reauthenticate();
		try {
			return service.getFeed(squery, SpreadsheetFeed.class);
		} catch (Exception ex2) {
			throw new SpreadsheetOperationException("Error getting spreadsheet feed. Possibly bad authentication or connection problems. " + ex2);
		}
	}
}
 
開發者ID:kenweezy,項目名稱:teiid,代碼行數:18,代碼來源:GDataClientLoginAPI.java

示例3: getSpreadsheetEntryByTitle

import com.google.gdata.client.spreadsheet.SpreadsheetQuery; //導入依賴的package包/類
public SpreadsheetEntry getSpreadsheetEntryByTitle(String sheetTitle) {
	SpreadsheetQuery squery = new SpreadsheetQuery(factory.getSpreadsheetsFeedUrl());
	squery.setTitleExact(true);
	squery.setTitleQuery(sheetTitle);
	SpreadsheetFeed feed = (SpreadsheetFeed) getSpreadsheetFeedQuery(squery, SpreadsheetFeed.class);
	List<SpreadsheetEntry> entry = feed.getEntries();
	if (entry.size() == 0)
		throw new SpreadsheetOperationException("Couldn't find spreadsheet:" + sheetTitle);

	return entry.get(0);
}
 
開發者ID:kenweezy,項目名稱:teiid,代碼行數:12,代碼來源:GDataClientLoginAPI.java

示例4: extractSpreadSheetFeed

import com.google.gdata.client.spreadsheet.SpreadsheetQuery; //導入依賴的package包/類
private SpreadsheetFeed extractSpreadSheetFeed() throws SQLException {
    URL spreadSheetFeedUrl;
    try {
        spreadSheetFeedUrl = this.feedProcessor.getSpreadSheetFeedUrl();
    } catch (MalformedURLException e) {
        throw new SQLException("Error occurred while constructing the Spread Sheet Feed URL");
    }
    SpreadsheetQuery spreadSheetQuery =
            TDriverUtil.createSpreadSheetQuery(this.getSpreadSheetName(), spreadSheetFeedUrl);
    return this.feedProcessor.getFeed(spreadSheetQuery, SpreadsheetFeed.class);
}
 
開發者ID:wso2,項目名稱:carbon-data,代碼行數:12,代碼來源:TGSpreadConnection.java


注:本文中的com.google.gdata.client.spreadsheet.SpreadsheetQuery類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。