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

com.ingenico.connect.gateway.sdk.java.logging.PropertyObfuscator Maven / Gradle / Ivy

Go to download

SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API

There is a newer version: 6.47.0
Show newest version
package com.ingenico.connect.gateway.sdk.java.logging;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

final class PropertyObfuscator extends Obfuscator {

	private final Pattern propertyPattern;

	PropertyObfuscator(Map obfuscators) {
		// case sensitive
		super(obfuscators, false);
		this.propertyPattern = buildPropertyPattern(obfuscators.keySet());
	}

	private Pattern buildPropertyPattern(Set propertyNames) {
		if (propertyNames.isEmpty()) {
			// no matches possible
			return Pattern.compile("$^");
		}

		Iterator iterator = propertyNames.iterator();

		/*
		 * Regex to create: (["'])(X|Y|Z)\1\s*:\s*(?:(["'])(.*?)(?




© 2015 - 2024 Weber Informatics LLC | Privacy Policy