Files
github-api/src/main/java/org/kohsuke/github/GHFileNotFoundException.java
2019-11-18 11:35:45 -08:00

49 lines
1.2 KiB
Java

package org.kohsuke.github;
import java.io.FileNotFoundException;
import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;
import javax.annotation.CheckForNull;
/**
* Request/responce contains useful metadata. Custom exception allows store info for next diagnostics.
*
* @author Kanstantsin Shautsou
*/
public class GHFileNotFoundException extends FileNotFoundException {
protected Map<String, List<String>> responseHeaderFields;
/**
* Instantiates a new Gh file not found exception.
*/
public GHFileNotFoundException() {
}
/**
* Instantiates a new Gh file not found exception.
*
* @param s
* the s
*/
public GHFileNotFoundException(String s) {
super(s);
}
/**
* Gets response header fields.
*
* @return the response header fields
*/
@CheckForNull
public Map<String, List<String>> getResponseHeaderFields() {
return responseHeaderFields;
}
GHFileNotFoundException withResponseHeaderFields(HttpURLConnection urlConnection) {
this.responseHeaderFields = urlConnection.getHeaderFields();
return this;
}
}