com.googlecode.download.maven.plugin.internal.DownloadFailureException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of download-maven-plugin Show documentation
Show all versions of download-maven-plugin Show documentation
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.
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();
}
}