-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client request filter can enforce json media type,
getting rid of all the other ugly hack that would have done the same
- Loading branch information
Erich Birngruber
committed
Jan 21, 2014
1 parent
7149eea
commit 99434de
Showing
13 changed files
with
33 additions
and
249 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
api/src/main/java/at/outdated/bitcoin/exchange/api/client/RestExchangeClient.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
89 changes: 0 additions & 89 deletions
89
api/src/main/java/at/outdated/bitcoin/exchange/api/jaxb/JSONResolver.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
api/src/main/java/at/outdated/bitcoin/exchange/api/jaxb/JsonEnforcingFilter.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,23 @@ | ||
package at.outdated.bitcoin.exchange.api.jaxb; | ||
|
||
import javax.ws.rs.client.ClientRequestContext; | ||
import javax.ws.rs.client.ClientRequestFilter; | ||
import javax.ws.rs.client.ClientResponseContext; | ||
import javax.ws.rs.client.ClientResponseFilter; | ||
import javax.ws.rs.core.MediaType; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Created by ebirn on 21.01.14. | ||
*/ | ||
|
||
public class JsonEnforcingFilter implements ClientResponseFilter { | ||
|
||
|
||
@Override | ||
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { | ||
|
||
responseContext.getHeaders().putSingle("Content-Type", MediaType.APPLICATION_JSON); | ||
|
||
} | ||
} |
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
26 changes: 0 additions & 26 deletions
26
bitcurex/src/main/java/at/outdated/bitcoin/exchange/bitcurex/BitcurexJsonResolver.java
This file was deleted.
Oops, something went wrong.
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
21 changes: 0 additions & 21 deletions
21
bitkonan/src/main/java/at/outdated/bitcoin/exchange/bitkonan/BitkonanJsonResolver.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
bitstamp/src/main/java/at/outdated/bitcoin/exchange/bitstamp/BitstampJsonResolver.java
This file was deleted.
Oops, something went wrong.
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
21 changes: 0 additions & 21 deletions
21
btc-e/src/main/java/at/outdated/bitcoin/exchange/btce/BtcEJsonResolver.java
This file was deleted.
Oops, something went wrong.
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
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
23 changes: 0 additions & 23 deletions
23
mtgox/src/main/java/at/outdated/bitcoin/exchange/mtgox/MtGoxJSONResolver.java
This file was deleted.
Oops, something went wrong.