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

io.antmedia.StreamIdValidator Maven / Gradle / Ivy

package io.antmedia;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StreamIdValidator {
	private static Pattern namePattern = Pattern.compile("[^a-z0-9-_]", Pattern.CASE_INSENSITIVE);
	
	private StreamIdValidator() {
		
	}
	public static boolean isStreamIdValid(String id) {
		if (id != null) {
			Matcher m = namePattern.matcher(id);
			return !m.find();
		}
		//return true if name is null, it means that stream id will be generated
		return true;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy