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

com.logicbus.backend.message.tools.HostMask Maven / Gradle / Ivy

There is a newer version: 1.6.17
Show newest version
package com.logicbus.backend.message.tools;

import com.anysoft.util.Properties;
import com.anysoft.util.PropertiesConstants;

/**
 * 主机mask工具
 */
public class HostMask {
    protected boolean hostMask = true;
    public HostMask(Properties props){
        hostMask = PropertiesConstants.getBoolean(props,"servant.hostmask",hostMask);
    }
    public String getHost(String host){
        return hostMask ? host.replaceFirst("\\d{1,}\\.\\d{1,}\\.\\d{1,}\\.","*.*.*."):host;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy