package com.atlassian.stash.internal.scm.git.protocol.ssh;

import com.atlassian.event.api.EventPublisher;
import com.atlassian.bitbucket.i18n.I18nService;
import com.atlassian.stash.internal.scm.git.GitWriteTracker;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.request.RequestContext;
import com.atlassian.bitbucket.request.RequestManager;
import com.atlassian.bitbucket.scm.git.command.GitCommandBuilderFactory;
import com.atlassian.bitbucket.scm.git.GitScmConfig;
import com.atlassian.bitbucket.scm.git.GitConstants;
import com.atlassian.bitbucket.scm.ssh.ExitCodeCallback;

import javax.annotation.Nonnull;
import java.io.InputStream;
import java.io.OutputStream;

public class SshUploadArchive extends GitSshScmRequest {

    public SshUploadArchive(@Nonnull Repository repository, @Nonnull GitCommandBuilderFactory builderFactory,
                            @Nonnull GitScmConfig config, @Nonnull EventPublisher eventPublisher,
                            @Nonnull I18nService i18nService, @Nonnull ExitCodeCallback exitCodeCallback,
                            @Nonnull RequestManager requestManager, @Nonnull InputStream in, @Nonnull OutputStream out,
                            @Nonnull OutputStream err, @Nonnull GitWriteTracker writeTracker) {
        super(repository, false, builderFactory, config, eventPublisher, i18nService, exitCodeCallback, requestManager,
                GitSshUtils.COMMAND_UPLOAD_ARCHIVE, in, out, err, writeTracker);
    }

    @Override
    protected void addLabels(@Nonnull RequestContext requestContext) {
        requestContext.addLabel(GitConstants.LABEL_ARCHIVE);
    }
}
