public class LightGSheetService extends Object
| Constructor and Description |
|---|
LightGSheetService(GSheetApiRequestFactory gSheetApiRequestFactory,
GSheetsClient gsClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteSheets(String spreadsheetId,
Collection<Integer> sheetIds) |
List<com.google.api.services.sheets.v4.model.Sheet> |
listSheetsEagerly(String spreadsheetId)
Lists all sheets of a spreadsheet also fetching their cell data.
|
List<com.google.api.services.sheets.v4.model.Sheet> |
listSheetsLazily(String spreadsheetId)
Lists all sheets of a spreadsheet without loading their cell data.
|
com.google.api.services.sheets.v4.model.Sheet |
loadSheet(String spreadsheetId,
String sheetTitle)
Loads sheet from given spreadsheet, if exists.
|
void |
updateSheetStyle(String spreadsheetId,
Integer sheetId,
List<String> lockedCellEditors,
List<String> translatedAutomatically,
List<String> translatedHistorically)
Updates the style and configuration of a specified sheet in a Google Spreadsheet.
|
void |
uploadDataToGoogleSheet(String spreadsheetId,
String sheetTitle,
List<List<String>> sheetRows)
Stores data in a new sheet in given spreadsheet.
|
void |
uploadDataToGoogleSheet(String spreadsheetId,
String sheetTitle,
List<List<String>> sheetRows,
int rowsToFreeze,
int colsToFreeze)
Stores data in a new sheet in given spreadsheet.
|
public LightGSheetService(GSheetApiRequestFactory gSheetApiRequestFactory, GSheetsClient gsClient)
public List<com.google.api.services.sheets.v4.model.Sheet> listSheetsLazily(String spreadsheetId) throws GeneralSecurityException, IOException
spreadsheetId - id of spreadsheetspreadSheetIdGeneralSecurityExceptionIOExceptionpublic List<com.google.api.services.sheets.v4.model.Sheet> listSheetsEagerly(String spreadsheetId) throws GeneralSecurityException, IOException
spreadsheetId - id of spreadsheetspreadSheetIdGeneralSecurityExceptionIOExceptionpublic com.google.api.services.sheets.v4.model.Sheet loadSheet(String spreadsheetId, String sheetTitle) throws GeneralSecurityException, IOException
spreadsheetId - id of spreadsheet to find insheetTitle - title of sheet to findsheetTitle from spreadsheet , or null if not foundGeneralSecurityExceptionIOExceptionpublic void uploadDataToGoogleSheet(String spreadsheetId, String sheetTitle, List<List<String>> sheetRows) throws GeneralSecurityException, IOException
spreadsheetId - id of spreadsheet to create sheet insheetTitle - name of the new sheetsheetRows - sheet data to storeGeneralSecurityExceptionIOExceptionpublic void uploadDataToGoogleSheet(String spreadsheetId, String sheetTitle, List<List<String>> sheetRows, int rowsToFreeze, int colsToFreeze) throws GeneralSecurityException, IOException
spreadsheetId - id of spreadsheet to create sheet insheetTitle - name of the new sheetsheetRows - sheet data to storerowsToFreeze - number of rows to freezecolsToFreeze - number of cols to freezeGeneralSecurityExceptionIOExceptionpublic void updateSheetStyle(String spreadsheetId, Integer sheetId, List<String> lockedCellEditors, List<String> translatedAutomatically, List<String> translatedHistorically) throws GeneralSecurityException, IOException
spreadsheetId - the ID of the Google SpreadsheetsheetId - the ID of the sheet within the spreadsheet to updatelockedCellEditors - a list of email addresses permitted to edit protected cells in the first two columnstranslatedAutomatically - a list of cell identifiers (formatted as "row_column") to apply a specific background color, indicating automatic translationtranslatedHistorically - a list of cell identifiers (formatted as "row_column") to apply a different background color, indicating manual translation from historical dataGeneralSecurityException - if there is an authentication or API access issueIOException - if an issue occurs during communication with the Google Sheets APIpublic void deleteSheets(String spreadsheetId, Collection<Integer> sheetIds) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionCopyright © 2025 FG Forrest, a.s.. All rights reserved.