forked from IQSS/dataverse
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/edu/harvard/iq/dataverse/api/errorhandlers/RedirectionExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package edu.harvard.iq.dataverse.api.errorhandlers; | ||
|
||
import edu.harvard.iq.dataverse.util.BundleUtil; | ||
import javax.json.Json; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.ws.rs.RedirectionException; | ||
import javax.ws.rs.core.Context; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.ext.ExceptionMapper; | ||
import javax.ws.rs.ext.Provider; | ||
|
||
/** | ||
* | ||
* @author qqmyers | ||
*/ | ||
@Provider | ||
public class RedirectionExceptionHandler implements ExceptionMapper<RedirectionException> { | ||
|
||
@Context | ||
HttpServletRequest request; | ||
|
||
@Override | ||
public Response toResponse(RedirectionException ex) { | ||
return ex.getResponse(); | ||
} | ||
|
||
} |