All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.synopsys.integration.blackduck.codelocation.upload.UploadOutput Maven / Gradle / Ivy

Go to download

A library for using various capabilities of Black Duck, notably the REST API and signature scanning.

There is a newer version: 66.2.19
Show newest version
/*
 * blackduck-common
 *
 * Copyright (c) 2021 Synopsys, Inc.
 *
 * Use subject to the terms and conditions of the Synopsys End User Software License and Maintenance Agreement. All rights reserved worldwide.
 */
package com.synopsys.integration.blackduck.codelocation.upload;

import java.util.Optional;

import com.synopsys.integration.blackduck.codelocation.CodeLocationOutput;
import com.synopsys.integration.blackduck.codelocation.Result;
import com.synopsys.integration.util.NameVersion;

public class UploadOutput extends CodeLocationOutput {
    private final String response;

    private UploadOutput(final NameVersion projectAndVersion, final String codeLocationName, final Result result, final String response, final String errorMessage, final Exception exception) {
        super(result, projectAndVersion, codeLocationName, 1, errorMessage, exception);
        this.response = response;
    }

    public static UploadOutput SUCCESS(final NameVersion projectAndVersion, final String codeLocationName, final String response) {
        return new UploadOutput(projectAndVersion, codeLocationName, Result.SUCCESS, response, null, null);
    }

    public static UploadOutput FAILURE(final NameVersion projectAndVersion, final String codeLocationName, final String errorMessage, final Exception exception) {
        return new UploadOutput(projectAndVersion, codeLocationName, Result.FAILURE, null, errorMessage, exception);
    }

    public static UploadOutput FAILURE(final NameVersion projectAndVersion, final String codeLocationName, final String response, final String errorMessage, final Exception exception) {
        return new UploadOutput(projectAndVersion, codeLocationName, Result.FAILURE, response, errorMessage, exception);
    }

    public Optional getResponse() {
        return Optional.ofNullable(response);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy