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
/** | |
* @param key - client secret key | |
* @param data - can be any data (eg: http request or response payload) | |
* @return | |
*/ | |
public static String calculateHmacSHA1(String key, byte[] data) { | |
if (key == null || data == null || data.length <= 0) | |
return null; | |
String HMAC_SHA1_ALGORITHM = "HmacSHA1"; |
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
group 'com.rameshl.demos' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' | |
apply plugin: 'war' | |
apply plugin: 'appengine' | |
sourceCompatibility = 1.7 | |
repositories { |
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"?> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
version="2.5"> | |
<servlet> | |
<servlet-name>hello</servlet-name> | |
<servlet-class>com.rameshl.demos.helloworld.HelloWorldServlet</servlet-class> | |
</servlet> | |
<servlet-mapping> |
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
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> | |
<application>YOUR-PROJECT-ID</application> | |
<version>YOUR-VERSION-ID</version> | |
<threadsafe>true</threadsafe> | |
</appengine-web-app> |
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
ext { | |
//used libraries versions | |
libVersions = | |
[ | |
servletApi : '3.1.0', | |
junit : '4.12', | |
gae : '1.9.54', | |
googleGradlePlugin: '1.3.2', | |
] |
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
// dependencies version and config definitions | |
apply from: 'gradle/dependencies.gradle' | |
// project configurations | |
allprojects { | |
group 'com.rameshl.demos' | |
version '1.0' | |
} | |
subprojects { |
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
group 'com.rameshl.demos' | |
version '1.0' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compileOnly libs.servletApi |
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
group 'com.rameshl.demos' | |
version '1.0' | |
buildscript { | |
repositories { | |
jcenter() | |
mavenCentral() | |
} | |
dependencies { | |
// latest App Engine Gradle tasks |
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 com.rameshl.demo.servlets; | |
import com.rameshl.demos.service.GreetingService; | |
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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 enum AppMode { | |
// different types of environment | |
DEV, STAGING, LIVE; | |
} |
OlderNewer