Example usage for com.liferay.portal.kernel.util Validator isHostName

List of usage examples for com.liferay.portal.kernel.util Validator isHostName

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util Validator isHostName.

Prototype

public static boolean isHostName(String name) 

Source Link

Document

Returns true if the string is a valid host name.

Usage

From source file:de.uhh.l2g.plugins.service.impl.HostLocalServiceImpl.java

License:Open Source License

protected void validate(String name, String streamer) throws PortalException {

    //only default host db entries name field is allowed to be empty
    if (Validator.isNull(name)) {
        throw new HostNameException();
    }/*from  w ww . ja va2  s . c om*/

    if (Validator.isNull(streamer) || !Validator.isDomain(streamer) || !Validator.isHostName(streamer)) {
        throw new HostStreamerException();
    }

}