package yukihane.inqubus.util;

import nicobrowser.NamePattern;

/**
 *
 * @author yuki
 */
public class OutputNamePattern extends NamePattern {

    private static final String FILE_NAME_PATTERN = "{filename}";
    private String fileName = "";

    public OutputNamePattern(String pattern) {
        super(pattern);
        setIsNotLow(true);
    }

    public final void setFileName(String fileName) {
        this.fileName = fileName;
    }

    @Override
    protected String replacePlaceHolder(String str) {
        String res = super.replacePlaceHolder(str);
        return res.replace(FILE_NAME_PATTERN, fileName);
    }
}
