How to save spreadsheet to xlsx file

To save current workbook as file in supported format there is interface IFileWriter.

To get IFileWriter, call createWriter() from IWorkbook:

import com.intechcore.scomponents.scell.api.spreadsheet.service.IFileWriter;

public class CustomerExamples {
    private static final CompletableFuture<Optional<IScellApiResolver>> apiResolverFuture = ScellApiProvider.getApiResolverAsync();

    public static void main(String[] args) {
        apiResolverFuture.thenAccept(apiResolverOpt -> apiResolverOpt.ifPresent(apiResolver -> {

            ISpreadsheetApiProvider coreApiProvider = apiResolver.resolve(ISpreadsheetApiProvider.class); // Core API entry point

            IWorkbook newWorkbook = coreApiProvider.load(new File("spreadsheet.xlsx"), () -> null).join();// load spreadsheet

            IFileWriter fileWriter = newWorkbook.createWriter();
            
            fileWriter
                    .fileName("spreadsheet-copy")                                                         // set a new name
                    .save().join();                                                                       // save as with the new name
        })).join();
    }
}

To IWorkbook