class ImportExportServiceImpl implements ImportExportService, ZipFileInputManager, ApplicationContextAware {

    @Override
    //TODO: Thinking about having Map<String, String>
    public void doImport(File input, Map<String, String> importParams, String organizationId,
                         String brokenDependenciesStrategy, Locale locale, List<WarningDescriptor> warnings) throws ImportFailedException{
        Importer importer = this.getImporter();

        String processorId = pathProcessorFactory.getDefaultInputProcessor();
        PathProcessor processor = pathProcessorFactory.getProcessor(processorId);

        ImportTaskImpl task = new ImportTaskImpl();
        task.setWarnings(warnings);
        task.setExecutionContext(makeExecutionContext(locale));
        task.setParameters(createImportParameters(importParams)
                .setParameterValue(ORGANIZATION, organizationId)
                .setParameterValue(BROKEN_DEPENDENCIES, brokenDependenciesStrategy));
        Boolean isEncrypted = importParams != null ? Boolean.parseBoolean(importParams.get("isEncrypted")) : null;
        if (isEncrypted != null && isEncrypted) {
            // Decrypt the file and put it into Importer
            // input = decrypted zip
            File decryptedInput = null;
            try {
                String key = null;
                if (importParams.containsKey(SECRET_KEY)) {
                    key = importParams.get(SECRET_KEY);

                } else if(importParams.containsKey(EncryptionParams.KEY_ALIAS_PARAMETER) ) {
                    final String alias = importParams.get(EncryptionParams.KEY_ALIAS_PARAMETER);
                    final KeystoreProperties props = keystoreManager.getKeystoreProperties(alias);
                    if (props.getKeyAlis() != null) {
                        final Key sKey = keystoreManager.getKey(props.getKeyAlis(), props.getKeyPasswd() != null ? props.getKeyPasswd() : "");
                        if (sKey != null) {
                            key = Hexer.stringify(sKey.getEncoded());
                        }
                    }
                }

                decryptedInput = diagnosticDataCipherer.decryptExportZip(input, key);
            } catch (Exception e) {
                log.error("Error while decrypting export.zip", e);
                throw new ImportFailedException(e.getMessage());
            }
            task.setInput(new ZipFileInput(decryptedInput, processor, this));
        } else {
            task.setInput(new ZipFileInput(input, processor, this));
        }
        task.setApplicationContext(getApplicationContext());

        startImport(importer, task);
    }

}