Search in sources :

Example 1 with StepHttpSwordInstaller

use of com.tyndalehouse.step.core.data.StepHttpSwordInstaller in project step by STEPBible.

the class DefaultInstallersProvider method getInstaller.

/**
 * @param splitParts the various parts of the installer property
 * @return an installer, properly configured with any relevant proxy
 */
protected synchronized Installer getInstaller(final String[] splitParts) {
    if (splitParts.length < 4) {
        return null;
    }
    final StepHttpSwordInstaller installer = new StepHttpSwordInstaller();
    installer.setInstallerName(splitParts[0]);
    installer.setHost(splitParts[1]);
    installer.setPackageDirectory(splitParts[2]);
    installer.setCatalogDirectory(splitParts[3]);
    if (isNotBlank(this.proxyHost) || isNotBlank(this.proxyPort)) {
        setManualProxy(installer);
    } else {
        setAvailableSystemProxy(installer);
    }
    return installer;
}
Also used : StepHttpSwordInstaller(com.tyndalehouse.step.core.data.StepHttpSwordInstaller)

Example 2 with StepHttpSwordInstaller

use of com.tyndalehouse.step.core.data.StepHttpSwordInstaller in project step by STEPBible.

the class BibleInformationServiceImpl method getInstallers.

@Override
public List<BibleInstaller> getInstallers() {
    List<BibleInstaller> bibleInstallers = new ArrayList<BibleInstaller>();
    final List<Installer> installers = this.jswordModule.getInstallers();
    for (int ii = 0; ii < installers.size(); ii++) {
        final Installer installer = installers.get(ii);
        String name = installer.getInstallerDefinition();
        boolean accessesInternet = true;
        if (installer instanceof StepHttpSwordInstaller) {
            name = ((StepHttpSwordInstaller) installer).getInstallerName();
            accessesInternet = true;
        } else if (installer instanceof DirectoryInstaller) {
            name = ((DirectoryInstaller) installer).getInstallerName();
            accessesInternet = false;
        }
        bibleInstallers.add(new BibleInstaller(ii, name, accessesInternet));
    }
    return bibleInstallers;
}
Also used : StepHttpSwordInstaller(com.tyndalehouse.step.core.data.StepHttpSwordInstaller) BibleInstaller(com.tyndalehouse.step.core.models.BibleInstaller) Installer(org.crosswire.jsword.book.install.Installer) DirectoryInstaller(com.tyndalehouse.step.core.data.DirectoryInstaller) ArrayList(java.util.ArrayList) BibleInstaller(com.tyndalehouse.step.core.models.BibleInstaller) DirectoryInstaller(com.tyndalehouse.step.core.data.DirectoryInstaller) StepHttpSwordInstaller(com.tyndalehouse.step.core.data.StepHttpSwordInstaller)

Aggregations

StepHttpSwordInstaller (com.tyndalehouse.step.core.data.StepHttpSwordInstaller)2 DirectoryInstaller (com.tyndalehouse.step.core.data.DirectoryInstaller)1 BibleInstaller (com.tyndalehouse.step.core.models.BibleInstaller)1 ArrayList (java.util.ArrayList)1 Installer (org.crosswire.jsword.book.install.Installer)1