VersionDefImpl.java 1.46 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.cq.dam.cfm.VersionDef
 *  com.day.cq.dam.api.Revision
 *  javax.jcr.RepositoryException
 *  javax.jcr.version.Version
 */
package com.adobe.cq.dam.cfm.impl;

import com.adobe.cq.dam.cfm.VersionDef;
import com.adobe.cq.dam.cfm.impl.VersioningException;
import com.day.cq.dam.api.Revision;
import javax.jcr.RepositoryException;
import javax.jcr.version.Version;

public class VersionDefImpl
implements VersionDef {
    private final Revision assetRevision;
    private final String identifier;
    private final String description;

    public VersionDefImpl(Revision assetRevision) throws VersioningException {
        this.assetRevision = assetRevision;
        Version version = assetRevision.getVersion();
        try {
            this.identifier = version.getIdentifier();
        }
        catch (RepositoryException re) {
            throw new VersioningException("Could not determine identifier.", (Throwable)re);
        }
        String description = "";
        try {
            description = version.getName();
        }
        catch (RepositoryException re) {
            // empty catch block
        }
        this.description = description;
    }

    public String getIdentifier() {
        return this.identifier;
    }

    public String getDescription() {
        return this.description;
    }

    public Revision getAssetRevision() {
        return this.assetRevision;
    }
}