class OakMachine {

    final void processPackageFile(final @NotNull Session admin,
                                  final @NotNull JcrPackageManager manager,
                                  final boolean preInstall,
                                  final @NotNull File file)
            throws AbortedScanException {
        try {
            admin.refresh(false);
        } catch (final RepositoryException e) {
            throw new AbortedScanException(e);
        }

        try (JcrPackage jcrPackage = manager.upload(file, false, true, null, true)) {
            processUploadedPackage(admin, manager, preInstall, jcrPackage);
        } catch (IOException | PackageException | RepositoryException | Fun.FunRuntimeException e) {
            throw new AbortedScanException(e, file);
        }
    }

    private  OakMachine(final Packaging packagingService,
                       final List<ProgressCheck> progressChecks,
                       final ErrorListener errorListener,
                       final List<URL> preInstallUrls,
                       final List<InitStage> initStages,
                       final JcrCustomizer jcrCustomizer,
                       final InstallHookProcessorFactory installHookProcessorFactory,
                       final ClassLoader installHookClassLoader,
                       final boolean enablePreInstallHooks,
                       final InstallHookPolicy scanInstallHookPolicy,
                       final Supplier<NodeStore> nodeStoreSupplier,
                       final SubpackageSilencer subpackageSilencer,
                       final RepoInitProcessor repoInitProcessor,
                       final SlingSimulatorBackend slingSimulator,
                       final Set<String> runModes);

}