This file contains hidden or 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
#!/usr/bin/python | |
import os | |
import subprocess as sp | |
import re | |
from sets import Set | |
if __name__ == '__main__': | |
print "Current working directory = %s" % (os.getcwd()) | |
cmd = "find %s -name *.java -exec grep 'Logger\.forK(' '{}' \;" % os.getcwd() | |
suspend = 'PhoneInterfaceManager,InputDispatcher,NetlinkEvent,UsbObserver,Tethering,Finsky,battery_widget_monitor,KINETO'.split(",") |
This file contains hidden or 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
import android.util.Log; | |
import static java.lang.String.format; | |
/** | |
* @author Ajay Kumar.N.S | |
* @since 1.0, 12/28/11, 11:52 PM | |
*/ | |
public final class Logger { |
This file contains hidden or 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.anadathur.springapp1; | |
import org.springframework.web.client.RestTemplate; | |
import com.anadathur.springapp1.model.Product; | |
public class ProductById{ | |
public static void main(String [] args){ | |
RestTemplate template = new RestTemplate(); | |
Product product = template.getForObject("http://kick-ass-product/api/product/{id}", Product.class, 123); | |
System.out.println("Product retrieved: " + product); |
This file contains hidden or 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.anadathur.springapp1.example; | |
import org.springframework.web.client.RestTemplate; | |
import com.anadathur.springapp1.model.Product; | |
public class CreateNewProduct{ | |
public static void main(String [] args){ | |
RestTemplate template = new RestTemplate(); | |
Product p = new Product(); | |
p.setName("Apple"); | |
p.setPrice(1.2f); |
This file contains hidden or 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
@RequestMapping("/api/product/") | |
public interface ProductClient { | |
@RequestMapping(value = "/{id}", method = RequestMethod.GET) | |
@ResponseBody | |
public Product withId(@PathVariable("id") int id); | |
@RequestMapping(method = RequestMethod.POST) | |
public Product createProduct(@RequestBody Product product); |
This file contains hidden or 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 ProxiedProductClient{ | |
public static void main(String[] args) { | |
RestTemplate template = new RestTemplate(); | |
ProductClient productClient = RestClientProxy.createProxy("http://localhost:8080/test-server/", template, ProductClient.class); | |
//System.out.println(productClient.withId(123)); | |
Random rand = new Random(); | |
for (int i = 0; i < 10; ++i) { | |
Product p = new Product(); | |
p.setName("apple"); | |
p.setPrice(rand.nextFloat()); |