package com.atlassian.bitbucket.internal.scm.git.lfs.mirror;

import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.util.contentcache.ContentProvider;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;

public class LfsContentProvider implements ContentProvider {

    private final UpstreamLfsClient client;
    private final String oid;
    private final Repository repository;

    public LfsContentProvider(Repository repository, String oid, UpstreamLfsClient client) {
        this.repository = repository;
        this.oid = oid;
        this.client = client;
    }

    @Override
    public void apply(OutputStream out) throws IOException {
        client.requestObject(repository, oid, out);
    }

    @Override
    public Date getExpiry() {
        return null;
    }
}
