AbstractReplicationContent.java 1.64 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.day.cq.replication.impl;

import com.day.cq.replication.ReplicationContent;
import com.day.cq.replication.ReplicationContentFacade;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

abstract class AbstractReplicationContent
implements ReplicationContent,
Serializable {
    private static final long serialVersionUID = -4842104625200454369L;
    protected final ReplicationContentFacade facade;

    protected AbstractReplicationContent(String path, String contentType, long contentLength) {
        this(new ReplicationContentFacade(path, contentType, contentLength));
    }

    protected AbstractReplicationContent(ReplicationContentFacade facade) {
        this.facade = facade;
    }

    @Override
    public ReplicationContentFacade getFacade() {
        return this.facade;
    }

    @Override
    public String getContentType() {
        return this.facade.getContentType();
    }

    @Override
    public long getContentLength() {
        return this.facade.getContentLength();
    }

    private void writeObject(ObjectOutputStream out) throws IOException {
        throw new NotSerializableException();
    }

    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        throw new NotSerializableException();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.getClass().getName());
        sb.append("{facade=").append(this.facade);
        sb.append('}');
        return sb.toString();
    }
}