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

com.googlecode.download.maven.plugin.internal.DownloadFailureException Maven / Gradle / Ivy

Go to download

This is a plugin meant to help maven user to download different files on different protocol in part of maven build. For the first implementation, there will only be a goal that will help downloading a maven artifact from the command line. Future version of the plugin could include web download, ftp download, scp download and so on.

The newest version!
package com.googlecode.download.maven.plugin.internal;

/**
 * Represents a download failure exception, thrown when the requested resource returns
 * a non-20x HTTP code.
 */
public final class DownloadFailureException extends RuntimeException {

    private final int statusCode;

    private final String statusLine;

    /**
     * @return the HTTP status code.
     */
    public int getHttpCode() {
        return statusCode;
    }

    /**
     * @return the HTTP status line.
     */
    public String getStatusLine() {
        return statusLine;
    }

    /**
     * Creates a new instance.
     * @param statusCode HTTP code
     * @param statusLine status line
     */
    public DownloadFailureException(int statusCode, String statusLine) {
        this.statusCode = statusCode;
        this.statusLine = statusLine;
    }

    @Override
    public String getMessage() {
        return "Download failed with code " + getHttpCode() + ": " + getStatusLine();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy