All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.galasa.framework.internal.creds.FileCredentialsRegistration Maven / Gradle / Ivy

There is a newer version: 0.37.0
Show newest version
/*
 * Copyright contributors to the Galasa project
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package dev.galasa.framework.internal.creds;

import java.net.URI;

import javax.validation.constraints.NotNull;

import org.osgi.service.component.annotations.Component;

import dev.galasa.framework.spi.IFrameworkInitialisation;
import dev.galasa.framework.spi.creds.CredentialsException;
import dev.galasa.framework.spi.creds.ICredentialsStoreRegistration;

/**
 * 
 * 
 *  
 */
@Component(service = { ICredentialsStoreRegistration.class })
public class FileCredentialsRegistration implements ICredentialsStoreRegistration {

    /**
     * 

* This method registers this as the only Creds file. *

* * @param frameworkInitialisation * @throws CredentialsException */ @Override public void initialise(@NotNull IFrameworkInitialisation frameworkInitialisation) throws CredentialsException { try { URI creds = frameworkInitialisation.getCredentialsStoreUri(); if (creds.getScheme().equals("file")) { FileCredentialsStore fcs = new FileCredentialsStore(creds, frameworkInitialisation.getFramework()); frameworkInitialisation.registerCredentialsStore(fcs); } } catch (Exception e) { throw new CredentialsException("Could not initialise Framework Property File CREDs", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy