package de.thedevstack.conversationsplus.utils; import java.net.URL; import de.thedevstack.conversationsplus.utils.CryptoHelper; /** * This utility class provides helper methods to handle URLs. */ public final class UrlUtil { public static byte[] getIvAndKeyFromURL(URL url) { if (null == url) { return null; } String reference = url.getRef(); boolean linkHasIvAndKey = reference != null && reference.matches("([A-Fa-f0-9]{2}){48}"); return linkHasIvAndKey ? CryptoHelper.hexToBytes(reference) : null; } private UrlUtil() { // Helper Class } }