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
package org.example.www.filters; | |
import java.io.IOException; | |
import java.util.*; | |
import javax.servlet.*; | |
import javax.servlet.http.*; | |
/** | |
* Modifies Accept headers and allows URL extensions to improve JAX-RS content negotiation | |
* Adds "Vary: accept" header to response |
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
public class AsyncTest extends Controller | |
{ | |
public static void callback() | |
{ | |
F.Promise<WS.HttpResponse> remoteCall1 = WS.url("http://www.remote-service.com/data/1").getAsync(); | |
F.Promise<WS.HttpResponse> remoteCall2 = WS.url("http://www.remote-service.com/data/2").getAsync(); | |
F.Promise<WS.HttpResponse> remoteCall3 = WS.url("http://www.remote-service.com/data/3").getAsync(); | |
F.Promise<List<WS.HttpResponse>> promises = F.Promise.waitAll(remoteCall1, remoteCall2, remoteCall3); |
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
package ****.elasticsearch.index; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import org.apache.commons.logging.Log; |
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
/* | |
Copyright (c) 2011 Damien Antipa, http://www.nethead.at/, http://damien.antipa.at | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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
package controllers; | |
import controllers.Constants; | |
import play.mvc.Controller; | |
import utils.PaginationInfo; | |
import java.util.List; | |
/** | |
* Sample controller. | |
*/ |
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
<script> | |
// <snip> | |
(function (window, document) { | |
var loader = function () { | |
var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0]; | |
script.src = "http://errorception.com/projects/" + _errs[0] + "/beacon.js"; | |
tag.parentNode.insertBefore(script, tag); | |
}; | |
// Wait until window.onload before downloading any more code. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example</groupId> | |
<artifactId>my-project</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<dependencies> | |
<!-- none yet --> |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
## END INIT INFO | |
# Path to play install folder | |
PLAY_HOME=/usr/share/play | |
PLAY=$PLAY_HOME/play | |
# Path to the JVM | |
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk |
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
.fc { | |
direction: ltr; | |
text-align: left; } | |
.fc table { | |
border-collapse: collapse; | |
border-spacing: 0; } | |
.fc .btn { | |
line-height: 1.2em; } | |
html .fc { |
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
//First create the httpClient in Dropwizard's run method as documented | |
final HttpClient httpClient = new HttpClientBuilder().using(configuration.getHttpClient()).build(); | |
try { | |
//Create KeyStore obejcts for both the keystore and truststore | |
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); | |
KeyStore truststore = KeyStore.getInstance(KeyStore.getDefaultType()); | |
//Then load the actual keystore/truststore file(s), they are the same file in my case | |
keystore.load(new FileInputStream(configuration.getKeyStore()), configuration.getKeyStorePassword().toCharArray()); |
OlderNewer