tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static OIDCCred readOIDCCredFile(String fileLocation, boolean isDelete) {
		File oidcFile = null;
		log.debug("Trying to read oidccred file");
		try {
			oidcFile = new File(fileLocation+"/oidccred");
			if (oidcFile != null && oidcFile.exists()) {
				oidcCred = new OIDCCred();
				Scanner sc = new Scanner(oidcFile);
				while (sc.hasNextLine()) {
					String line = sc.nextLine();
					if (line.startsWith(OIDCCLIENTNAMESTR)) {
						oidcClientName = line.substring(OIDCCLIENTNAMESTR.length(), line.length());
						oidcCred.setClientName(line.substring(OIDCCLIENTNAMESTR.length(), line.length()));
						log.debug("Successfully read OIDC_CLIENT_NAME from oidcCred file");
					}
					else if (line.startsWith(OIDCCLIENTIDSTR)) {
						oidcClientId = line.substring(OIDCCLIENTIDSTR.length(), line.length());
						oidcCred.setClientId(line.substring(OIDCCLIENTIDSTR.length(), line.length()));
						log.debug("Successfully read OIDC_CLIENT_ID from oidcCred file");
					}
					else if (line.startsWith(OIDCCLIENTSECRETSTR)) {
						oidcClientSecret = line.substring(OIDCCLIENTSECRETSTR.length(), line.length());
						oidcCred.setClientSecret(line.substring(OIDCCLIENTSECRETSTR.length(), line.length()));
						log.debug("Successfully read OIDC_CLIENT_SECRET from oidcCred file");
					}
					else if (line.startsWith(BOUNDAUDIENCE)) {
						oidcBoundAudiences = line.substring(BOUNDAUDIENCE.length(), line.length());
						oidcCred.setBoundAudiences(line.substring(BOUNDAUDIENCE.length(), line.length()));
						log.debug("Successfully read BOUND_AUDIENCES from oidcCred file");
					}
					else if (line.startsWith(OIDCURL)) {
						oidcDiscoveryUrl = line.substring(OIDCURL.length(), line.length());
						oidcCred.setDiscoveryUrl(line.substring(OIDCURL.length(), line.length()));
						log.debug("Successfully read OIDC_DISCOVERY_URL from oidcCred file");
					}
					else if (line.startsWith(ADLOGINURL)) {
						oidcADLoginUrl = line.substring(ADLOGINURL.length(), line.length());
						oidcCred.setAdLoginUrl(line.substring(ADLOGINURL.length(), line.length()));
						log.debug("Successfully read AD_LOGIN_URL from oidcCred file");
					}
				}
				sc.close();
			}
		} catch (IOException e) {
			log.error(String.format("Unable to read oidcCred file: [%s]", e.getMessage()));
		}
		try {
			if (oidcFile != null && oidcFile.exists() && isDelete) {
				if (oidcFile.delete()) {
					log.debug("Successfully deleted oidcCred file");
				}
				else {
					log.error("Unable to get delete oidcCred file");
				}
			}
		} catch (Exception e) {
			log.error(String.format("Unable to get delete oidcCred file: [%s]", e.getMessage()));
		}
		return oidcCred;
	}
/**
	 * Reads the OIDCCred from the location.
	 * @param fileLocation
	 * @param isDelete
	 * @return
	 */
Reads the OIDCCred from the location.
@param fileLocation
@param isDelete
@return
Reads the OIDCCred from the location . @param fileLocation @param isDelete @return
public static OIDCCred readOIDCCredFile(String fileLocation, boolean isDelete) {
		File oidcFile = null;
		log.debug("Trying to read oidccred file");
		try {
			oidcFile = new File(fileLocation+"/oidccred");
			if (oidcFile != null && oidcFile.exists()) {
				oidcCred = new OIDCCred();
				Scanner sc = new Scanner(oidcFile);
				while (sc.hasNextLine()) {
					String line = sc.nextLine();
					if (line.startsWith(OIDCCLIENTNAMESTR)) {
						oidcClientName = line.substring(OIDCCLIENTNAMESTR.length(), line.length());
						oidcCred.setClientName(line.substring(OIDCCLIENTNAMESTR.length(), line.length()));
						log.debug("Successfully read OIDC_CLIENT_NAME from oidcCred file");
					}
					else if (line.startsWith(OIDCCLIENTIDSTR)) {
						oidcClientId = line.substring(OIDCCLIENTIDSTR.length(), line.length());
						oidcCred.setClientId(line.substring(OIDCCLIENTIDSTR.length(), line.length()));
						log.debug("Successfully read OIDC_CLIENT_ID from oidcCred file");
					}
					else if (line.startsWith(OIDCCLIENTSECRETSTR)) {
						oidcClientSecret = line.substring(OIDCCLIENTSECRETSTR.length(), line.length());
						oidcCred.setClientSecret(line.substring(OIDCCLIENTSECRETSTR.length(), line.length()));
						log.debug("Successfully read OIDC_CLIENT_SECRET from oidcCred file");
					}
					else if (line.startsWith(BOUNDAUDIENCE)) {
						oidcBoundAudiences = line.substring(BOUNDAUDIENCE.length(), line.length());
						oidcCred.setBoundAudiences(line.substring(BOUNDAUDIENCE.length(), line.length()));
						log.debug("Successfully read BOUND_AUDIENCES from oidcCred file");
					}
					else if (line.startsWith(OIDCURL)) {
						oidcDiscoveryUrl = line.substring(OIDCURL.length(), line.length());
						oidcCred.setDiscoveryUrl(line.substring(OIDCURL.length(), line.length()));
						log.debug("Successfully read OIDC_DISCOVERY_URL from oidcCred file");
					}
					else if (line.startsWith(ADLOGINURL)) {
						oidcADLoginUrl = line.substring(ADLOGINURL.length(), line.length());
						oidcCred.setAdLoginUrl(line.substring(ADLOGINURL.length(), line.length()));
						log.debug("Successfully read AD_LOGIN_URL from oidcCred file");
					}
				}
				sc.close();
			}
		} catch (IOException e) {
			log.error(String.format("Unable to read oidcCred file: [%s]", e.getMessage()));
		}
		try {
			if (oidcFile != null && oidcFile.exists() && isDelete) {
				if (oidcFile.delete()) {
					log.debug("Successfully deleted oidcCred file");
				}
				else {
					log.error("Unable to get delete oidcCred file");
				}
			}
		} catch (Exception e) {
			log.error(String.format("Unable to get delete oidcCred file: [%s]", e.getMessage()));
		}
		return oidcCred;
	}
public static OIDCCred readOIDCCredFile ( String fileLocation , boolean isDelete ) { File oidcFile = null ; log . debug ( "Trying to read oidccred file" ) ; try { oidcFile = new File ( fileLocation + "/oidccred" ) ; if ( oidcFile != null && oidcFile . exists ( ) ) { oidcCred = new OIDCCred ( ) ; Scanner sc = new Scanner ( oidcFile ) ; while ( sc . hasNextLine ( ) ) { String line = sc . nextLine ( ) ; if ( line . startsWith ( OIDCCLIENTNAMESTR ) ) { oidcClientName = line . substring ( OIDCCLIENTNAMESTR . length ( ) , line . length ( ) ) ; oidcCred . setClientName ( line . substring ( OIDCCLIENTNAMESTR . length ( ) , line . length ( ) ) ) ; log . debug ( "Successfully read OIDC_CLIENT_NAME from oidcCred file" ) ; } else if ( line . startsWith ( OIDCCLIENTIDSTR ) ) { oidcClientId = line . substring ( OIDCCLIENTIDSTR . length ( ) , line . length ( ) ) ; oidcCred . setClientId ( line . substring ( OIDCCLIENTIDSTR . length ( ) , line . length ( ) ) ) ; log . debug ( "Successfully read OIDC_CLIENT_ID from oidcCred file" ) ; } else if ( line . startsWith ( OIDCCLIENTSECRETSTR ) ) { oidcClientSecret = line . substring ( OIDCCLIENTSECRETSTR . length ( ) , line . length ( ) ) ; oidcCred . setClientSecret ( line . substring ( OIDCCLIENTSECRETSTR . length ( ) , line . length ( ) ) ) ; log . debug ( "Successfully read OIDC_CLIENT_SECRET from oidcCred file" ) ; } else if ( line . startsWith ( BOUNDAUDIENCE ) ) { oidcBoundAudiences = line . substring ( BOUNDAUDIENCE . length ( ) , line . length ( ) ) ; oidcCred . setBoundAudiences ( line . substring ( BOUNDAUDIENCE . length ( ) , line . length ( ) ) ) ; log . debug ( "Successfully read BOUND_AUDIENCES from oidcCred file" ) ; } else if ( line . startsWith ( OIDCURL ) ) { oidcDiscoveryUrl = line . substring ( OIDCURL . length ( ) , line . length ( ) ) ; oidcCred . setDiscoveryUrl ( line . substring ( OIDCURL . length ( ) , line . length ( ) ) ) ; log . debug ( "Successfully read OIDC_DISCOVERY_URL from oidcCred file" ) ; } else if ( line . startsWith ( ADLOGINURL ) ) { oidcADLoginUrl = line . substring ( ADLOGINURL . length ( ) , line . length ( ) ) ; oidcCred . setAdLoginUrl ( line . substring ( ADLOGINURL . length ( ) , line . length ( ) ) ) ; log . debug ( "Successfully read AD_LOGIN_URL from oidcCred file" ) ; } } sc . close ( ) ; } } catch ( IOException e ) { log . error ( String . format ( "Unable to read oidcCred file: [%s]" , e . getMessage ( ) ) ) ; } try { if ( oidcFile != null && oidcFile . exists ( ) && isDelete ) { if ( oidcFile . delete ( ) ) { log . debug ( "Successfully deleted oidcCred file" ) ; } else { log . error ( "Unable to get delete oidcCred file" ) ; } } } catch ( Exception e ) { log . error ( String . format ( "Unable to get delete oidcCred file: [%s]" , e . getMessage ( ) ) ) ; } return oidcCred ; }
Reads the OIDCCred from the location.
Reads the OIDCCred from the location .