BinaryLessUtils.java 976 Bytes
/*
 * Decompiled with CFR 0_118.
 */
package com.day.cq.replication.impl.bl;

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

public class BinaryLessUtils {
    public static final String BINARY_LESS_FLAG = "binaryless";
    public static final String MISSING_BINARIES_MESSAGE_START = "FAILED PATHS START";
    public static final String MISSING_BINARIES_MESSAGE_END = "FAILED PATHS END";
    private static final Pattern referencePropertyPattern = Pattern.compile("(binary\\_reference)\\_(.+)");

    public static String encodeProperty(String propertyName) {
        return "binary_reference_" + propertyName.replace(":", "__");
    }

    public static String decodeProperty(String referncePropertyName) {
        String propertyName = null;
        Matcher m = referencePropertyPattern.matcher(referncePropertyName);
        if (m.matches()) {
            propertyName = m.group(2).replaceFirst("__", ":");
        }
        return propertyName;
    }
}