* List worksheet names without loading the workbook's cell data. */
(string $userId, string $path)
| 80 | * List worksheet names without loading the workbook's cell data. |
| 81 | */ |
| 82 | public function listWorksheetNames(string $userId, string $path): array { |
| 83 | $file = $this->rootFolder->getUserFolder($userId)->get($path); |
| 84 | if (!$file instanceof \OCP\Files\File) { |
| 85 | throw new \InvalidArgumentException('Spreadsheet path is not a file'); |
| 86 | } |
| 87 | |
| 88 | include_once __DIR__ . '/../../vendor/autoload.php'; |
| 89 | $fileName = $file->getStorage()->getLocalFile($file->getInternalPath()); |
| 90 | $reader = IOFactory::createReader(IOFactory::identify($fileName)); |
| 91 | return $reader->listWorksheetNames($fileName); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Read the Data |