Commit 069ea2bf authored by vikram singh's avatar vikram singh

initial commit

parent 62867a39
package com.nisum.java9Features.DiamondOperator; package com.nisum.java9Features.DiamondOperator;
import java.util.logging.Logger;
public class MyGenClass<T> { public class MyGenClass<T> {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
T obj; T obj;
public MyGenClass(T obj) public MyGenClass(T obj)
{ {
...@@ -12,6 +16,6 @@ public class MyGenClass<T> { ...@@ -12,6 +16,6 @@ public class MyGenClass<T> {
} }
public void process() public void process()
{ {
System.out.println("Processing obj..."); log.info("Processing obj...");
} }
} }
package com.nisum.java9Features.FactoryMethodsForUnmodifiableCollections; package com.nisum.java9Features.FactoryMethodsForUnmodifiableCollections;
import java.util.*;
import java.util.List;
import java.util.logging.Logger;
public class UnmodifiableList { public class UnmodifiableList {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
static Employee e1,e2,e3,e5;
public static void main(String[] args) { public static void main(String[] args) {
Employee e1=new Employee(100,"sunny"); e1=new Employee(100,"sunny");
Employee e2=new Employee(101, "Bunny"); e2=new Employee(101, "Bunny");
Employee e3=new Employee(102,"Chinny"); e3=new Employee(102,"Chinny");
// Employee e4=null;
//List<Employee> emplist=List.of(e1,e2,e3,e4);
List<Employee> emplist=List.of(e1,e2,e3); List<Employee> emplist=List.of(e1,e2,e3);
System.out.println(emplist); log.info("{}"+ emplist);
Employee e5=new Employee(103,"Laddu"); e5=new Employee(103,"Laddu");
//emplist.add(e5); // Unsupported Exception
} }
} }
package com.nisum.java9Features.FactoryMethodsForUnmodifiableCollections; package com.nisum.java9Features.FactoryMethodsForUnmodifiableCollections;
import java.sql.*;
import java.util.*;
import java.util.Map;
import java.util.logging.Logger;
import static java.util.Map.entry; import static java.util.Map.entry;
public class UnmodifiableMap { public class UnmodifiableMap {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
static Map<String,String> map=Map.of("A","Apple","B","Banana","C","Cat","D","Dog")
,m;
static Map.Entry<String,String> e1,e2,e3;
public static void main(String[] args) { public static void main(String[] args) {
Map<String,String> map=Map.of("A","Apple","B","Banana","C","Cat","D","Dog"); log.info("{}"+map);
System.out.println(map);
/* Map<String,String> map1=Map.of("A","Apple","A","Banana","C","Cat","D","Dog");
System.out.println(map1); // IllegalArgumentException*/
/*Map<String,String> map2=Map.of("A",null,"B","Banana"); // NullPointerException
System.out.println(map2);*/
Map.Entry<String,String> e1= entry("A","Apple");
Map.Entry<String,String> e2= entry("B","Banana");
Map.Entry<String,String> e3= entry("C","Cat");
Map<String,String> m=Map.ofEntries(e1,e2,e3);
System.out.println(m);
/* Map<String,String> map3=Map.ofEntries(entry(null,"Apple"),entry("B","Banana")); // NullPointerException
System.out.println(map3);*/
/* Map<String,String> map4=Map.ofEntries(entry("A","Apple"),entry("B","Banana")); e1= entry("A","Apple");
map4.put("C","Cat"); // UnsupportedOperationException e2= entry("B","Banana");
map4.remove("A");//UnsupportedOperationException*/ e3= entry("C","Cat");
m=Map.ofEntries(e1,e2,e3);
log.info("{}"+m);
} }
......
package com.nisum.java9Features.FactoryMethodsForUnmodifiableCollections; package com.nisum.java9Features.FactoryMethodsForUnmodifiableCollections;
import java.util.*;
import java.util.Set;
import java.util.logging.Logger;
public class UnmodifiableSet { public class UnmodifiableSet {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
static Employee e1,e2,e3,e5;
static Set<Employee> emplist;
public static void main(String[] args) { public static void main(String[] args) {
Employee e1=new Employee(100,"sunny"); e1=new Employee(100,"sunny");
Employee e2=new Employee(101, "Bunny"); e2=new Employee(101, "Bunny");
Employee e3=new Employee(102,"Chinny"); e3=new Employee(102,"Chinny");
// Employee e4=null; // Employee e4=null;
//List<Employee> emplist=List.of(e1,e2,e3,e4); //List<Employee> emplist=List.of(e1,e2,e3,e4);
Set<Employee> emplist=Set.of(e1,e2,e3,e3); emplist=Set.of(e1,e2,e3,e3);
System.out.println(emplist); log.info("{} "+ emplist);
Employee e5=new Employee(103,"Laddu"); Employee e5=new Employee(103,"Laddu");
//emplist.add(e5); // Unsupported Exception //emplist.add(e5); // Unsupported Exception
......
package com.nisum.java9Features.PrivateMethods; package com.nisum.java9Features.PrivateMethods;
import java.util.logging.Logger;
public interface Java9Interf public interface Java9Interf
{ {
final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
default void m1() default void m1()
{ {
m3(); m3();
...@@ -12,6 +16,6 @@ public interface Java9Interf ...@@ -12,6 +16,6 @@ public interface Java9Interf
} }
private void m3() private void m3()
{ {
System.out.println("common functionality of methods m1 & m2"); log.info("common functionality of methods m1 & m2");
} }
} }
package com.nisum.java9Features.PrivateMethods; package com.nisum.java9Features.PrivateMethods;
import java.util.logging.Logger;
public interface Java9InterfStatic { public interface Java9InterfStatic {
final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void m1() public static void m1()
{ {
m3(); m3();
...@@ -11,6 +15,6 @@ public interface Java9InterfStatic { ...@@ -11,6 +15,6 @@ public interface Java9InterfStatic {
} }
private static void m3() private static void m3()
{ {
System.out.println("common functionality of methods m1 & m2"); log.info("common functionality of methods m1 & m2");
} }
} }
package com.nisum.java9Features.PrivateMethods;
public class PrivateInstanceMethods implements Java9Interf
{
public static void main(String[] args) {
PrivateInstanceMethods t = new PrivateInstanceMethods();
t.m1();
t.m2();
//t.m3(); //CE
}
}
package com.nisum.java9Features.ProcessAPI; package com.nisum.java9Features.ProcessAPI;
import java.util.logging.Logger;
public class CurrentProcessInfo { public class CurrentProcessInfo {
public static void main(String[] args) throws Exception { private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
ProcessHandle p = ProcessHandle.current(); static ProcessHandle p;
ProcessHandle.Info info = p.info(); static ProcessHandle.Info info;
System.out.println("Complete Process Inforamtion:\n" + info); public static void main(String[] args) throws Exception {
System.out.println("User: " + info.user().get()); p = ProcessHandle.current();
System.out.println("Command: " + info.command().get()); info = p.info();
System.out.println("Start Time: " + info.startInstant().get()); log.info("Complete Process Inforamtion:\n" + info);
System.out.println("Total CPU Time Acquired: " + info.totalCpuDuration().get()); log.info("User: " + info.user().get());
log.info("Command: " + info.command().get());
log.info("Start Time: " + info.startInstant().get());
log.info("Total CPU Time Acquired: " + info.totalCpuDuration().get());
} }
} }
package com.nisum.java9Features.ProcessAPI; package com.nisum.java9Features.ProcessAPI;
import java.util.*;
import java.util.Optional;
import java.util.logging.Logger;
public class ProcessBasedOnID { public class ProcessBasedOnID {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
//need to get the pid from task manager //need to get the pid from task manager
Optional<ProcessHandle> opt = ProcessHandle.of(8408); Optional<ProcessHandle> opt = ProcessHandle.of(8408);
ProcessHandle p = opt.get(); ProcessHandle p = opt.get();
ProcessHandle.Info info = p.info(); ProcessHandle.Info info = p.info();
System.out.println("Complete Process Inforamtion:\n" + info); log.info("Complete Process Inforamtion:\n" + info);
System.out.println("User: " + info.user().get()); log.info("User: " + info.user().get());
System.out.println("Command: " + info.command().get()); log.info("Command: " + info.command().get());
System.out.println("Start Time: " + info.startInstant().get()); log.info("Start Time: " + info.startInstant().get());
System.out.println("Total CPU Time Acquired: " + info.totalCpuDuration().get()); log.info("Total CPU Time Acquired: " + info.totalCpuDuration().get());
} }
} }
package com.nisum.java9Features.ProcessAPI; package com.nisum.java9Features.ProcessAPI;
import java.util.logging.Logger;
public class ProcessID { public class ProcessID {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
ProcessHandle p = ProcessHandle.current(); ProcessHandle p = ProcessHandle.current();
long pid = p.pid(); long pid = p.pid();
System.out.println("The PID of current running JVM instance :" + pid); log.info("The PID of current running JVM instance :" + pid);
Thread.sleep(100000); Thread.sleep(100000);
} }
} }
package com.nisum.java9Features.ReactiveStreams; package com.nisum.java9Features.ReactiveStreams;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
public class EmpHelper { public class EmpHelper {
public static List<Employee> getEmps() { public static List<Employee> getEmps() {
......
package com.nisum.java9Features.ReactiveStreams; package com.nisum.java9Features.ReactiveStreams;
import java.util.*;
import java.util.concurrent.*; import java.util.List;
import java.util.concurrent.SubmissionPublisher;
import java.util.logging.Logger;
public class MyReactiveApp { public class MyReactiveApp {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String args[]) throws InterruptedException { public static void main(String args[]) throws InterruptedException {
// Create Publisher // Create Publisher
SubmissionPublisher<Employee> publisher = new SubmissionPublisher<>(); SubmissionPublisher<Employee> publisher = new SubmissionPublisher<>();
...@@ -15,7 +19,7 @@ public class MyReactiveApp { ...@@ -15,7 +19,7 @@ public class MyReactiveApp {
List<Employee> emps = EmpHelper.getEmps(); List<Employee> emps = EmpHelper.getEmps();
// Publish items // Publish items
System.out.println("Publishing Items to Subscriber"); log.info("Publishing Items to Subscriber");
emps.stream().forEach(i -> publisher.submit(i)); emps.stream().forEach(i -> publisher.submit(i));
// logic to wait till processing of all messages are over // logic to wait till processing of all messages are over
...@@ -25,7 +29,7 @@ public class MyReactiveApp { ...@@ -25,7 +29,7 @@ public class MyReactiveApp {
// close the Publisher // close the Publisher
publisher.close(); publisher.close();
System.out.println("Exiting the app"); log.info("Exiting the app");
} }
} }
package com.nisum.java9Features.ReactiveStreams; package com.nisum.java9Features.ReactiveStreams;
import java.util.concurrent.*;
import java.util.concurrent.Flow.Subscriber; import java.util.concurrent.Flow.Subscriber;
import java.util.concurrent.Flow.Subscription; import java.util.concurrent.Flow.Subscription;
import java.util.logging.Logger;
public class MySubscriber implements Subscriber<Employee> { public class MySubscriber implements Subscriber<Employee> {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
private Subscription subscription; private Subscription subscription;
private int counter = 0; private int counter = 0;
@Override @Override
public void onSubscribe(Subscription subscription) { public void onSubscribe(Subscription subscription) {
System.out.println("Subscribed"); log.info("Subscribed");
this.subscription = subscription; this.subscription = subscription;
this.subscription.request(1); //requesting data from publisher this.subscription.request(1); //requesting data from publisher
System.out.println("onSubscribe requested 1 item"); log.info("onSubscribe requested 1 item");
} }
@Override @Override
public void onNext(Employee item) { public void onNext(Employee item) {
System.out.println("Processing Employee " + item); log.info("Processing Employee " + item);
counter++; counter++;
this.subscription.request(1); this.subscription.request(1);
} }
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
System.out.println("Some error happened"); log.info("Some error happened");
e.printStackTrace(); e.printStackTrace();
} }
@Override @Override
public void onComplete() { public void onComplete() {
System.out.println("All Processing Done"); log.info("All Processing Done");
} }
public int getCounter() { public int getCounter() {
......
package com.nisum.java9Features.StreamApi; package com.nisum.java9Features.StreamApi;
import java.util.*;
import java.util.stream.*; import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import java.util.stream.Collectors;
public class TestDropWhile { public class TestDropWhile {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String[] args) { public static void main(String[] args) {
ArrayList<Integer> l1 = new ArrayList<Integer>(); ArrayList<Integer> l1 = new ArrayList<Integer>();
l1.add(2); l1.add(2);
...@@ -13,9 +19,8 @@ public class TestDropWhile { ...@@ -13,9 +19,8 @@ public class TestDropWhile {
l1.add(6); l1.add(6);
l1.add(5); l1.add(5);
l1.add(8); l1.add(8);
System.out.println("Initial List:" + l1); log.info("Initial List:" + l1);
List<Integer> l2 = l1.stream().dropWhile(i -> i % 2 == 0).collect(Collectors.toList()); List<Integer> l2 = l1.stream().dropWhile(i -> i % 2 == 0).collect(Collectors.toList());
System.out.println("After dropWhile:" + l2); log.info("After dropWhile:" + l2);
} }
} }
package com.nisum.java9Features.StreamApi; package com.nisum.java9Features.StreamApi;
import java.util.stream.*;
import java.util.logging.Logger;
import java.util.stream.Stream;
public class TestIterate { public class TestIterate {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String[] args) { public static void main(String[] args) {
//Stream.iterate(1, x->x+1).forEach(System.out::println); // return infinite elements //Stream.iterate(1, x->x+1).forEach(System.out::println); // return infinite elements
Stream.iterate(1, x->x+1).limit(5).forEach(System.out::println); Stream.iterate(1, x->x+1).limit(5).forEach(System.out::println);
System.out.println("3argument iterate"); log.info("3argument iterate");
Stream.iterate(1,x->x<10, x->x+1).forEach(System.out::println); Stream.iterate(1,x->x<10, x->x+1).forEach(System.out::println);
} }
} }
package com.nisum.java9Features.StreamApi; package com.nisum.java9Features.StreamApi;
import java.util.*;
import java.util.stream.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class TestOfNullable { public class TestOfNullable {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String[] args) { public static void main(String[] args) {
List<String> l = new ArrayList<String>(); List<String> l = new ArrayList<String>();
l.add("A"); l.add("A");
...@@ -12,12 +20,12 @@ public class TestOfNullable { ...@@ -12,12 +20,12 @@ public class TestOfNullable {
l.add("C"); l.add("C");
l.add("D"); l.add("D");
l.add(null); l.add(null);
System.out.println(l); log.info("l {}"+l);
List<String> l2 = l.stream().filter(o -> o != null).collect(Collectors.toList()); List<String> l2 = l.stream().filter(o -> o != null).collect(Collectors.toList());
System.out.println(l2); log.info("l2 {}"+l2);
List<String> l3 = l.stream().flatMap(o -> Stream.ofNullable(o)).collect(Collectors.toList()); List<String> l3 = l.stream().flatMap(o -> Stream.ofNullable(o)).collect(Collectors.toList());
System.out.println(l3); log.info("l3 {}"+l3);
Map<String, String> m = new HashMap<>(); Map<String, String> m = new HashMap<>();
m.put("A", "Apple"); m.put("A", "Apple");
...@@ -26,9 +34,9 @@ public class TestOfNullable { ...@@ -26,9 +34,9 @@ public class TestOfNullable {
m.put("D", "Dog"); m.put("D", "Dog");
m.put("E", null); m.put("E", null);
List<String> l4 = m.entrySet().stream().map(e -> e.getKey()).collect(Collectors.toList()); List<String> l4 = m.entrySet().stream().map(e -> e.getKey()).collect(Collectors.toList());
System.out.println(l4); log.info("l4 {}"+l4);
List<String> l5 = m.entrySet().stream().flatMap(e -> Stream.ofNullable(e.getValue())).collect(Collectors.toList()); List<String> l5 = m.entrySet().stream().flatMap(e -> Stream.ofNullable(e.getValue())).collect(Collectors.toList());
System.out.println(l5); log.info("l5 {}"+l5);
} }
} }
package com.nisum.java9Features.StreamApi; package com.nisum.java9Features.StreamApi;
import java.util.*; import java.util.ArrayList;
import java.util.stream.*;
import java.util.List;
import java.util.logging.Logger;
import java.util.stream.Collectors;
public class TestTakeWhile { public class TestTakeWhile {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void main(String[] args) { public static void main(String[] args) {
ArrayList<Integer> l1 = new ArrayList<Integer>(); ArrayList<Integer> l1 = new ArrayList<Integer>();
l1.add(2); l1.add(2);
l1.add(4); l1.add(4);
...@@ -13,10 +21,10 @@ public class TestTakeWhile { ...@@ -13,10 +21,10 @@ public class TestTakeWhile {
l1.add(6); l1.add(6);
l1.add(5); l1.add(5);
l1.add(8); l1.add(8);
System.out.println("Initial List:" + l1); log.info("Initial List:" + l1);
List<Integer> l2 = l1.stream().filter(i -> i % 2 == 0).collect(Collectors.toList()); List<Integer> l2 = l1.stream().filter(i -> i % 2 == 0).collect(Collectors.toList());
System.out.println("After Filtering:" + l2); log.info("After Filtering:" + l2);
List<Integer> l3 = l1.stream().takeWhile(i -> i % 2 == 0).collect(Collectors.toList()); List<Integer> l3 = l1.stream().takeWhile(i -> i % 2 == 0).collect(Collectors.toList());
System.out.println("After takeWhile:" + l3); log.info("After takeWhile:" + l3);
} }
} }
package com.nisum.java9Features.TryWithResourcesEnhancements; package com.nisum.java9Features.TryWithResourcesEnhancements;
import java.util.logging.Logger;
public class MyResources implements AutoCloseable { public class MyResources implements AutoCloseable {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
MyResources() MyResources()
{ {
System.out.println("Resource Creation..."); log.info("Resource Creation...");
} }
public void doProcess() public void doProcess()
{ {
System.out.println("Resource Processing..."); log.info("Resource Processing...");
} }
public void close() public void close()
{ {
System.out.println("Resource Closing..."); log.info("Resource Closing...");
} }
} }
package com.nisum.java9Features.TryWithResourcesEnhancements; package com.nisum.java9Features.TryWithResourcesEnhancements;
import lombok.extern.flogger.Flogger;
import lombok.extern.slf4j.Slf4j;
import java.util.logging.Logger;
public class TryWithResourceApp { public class TryWithResourceApp {
private final static Logger log =Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public static void preJDK7() public static void preJDK7()
{ {
MyResources r=null; MyResources r=null;
...@@ -11,7 +18,7 @@ public class TryWithResourceApp { ...@@ -11,7 +18,7 @@ public class TryWithResourceApp {
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Handling:"+e); log.info("Handling:"+e);
} }
finally finally
{ {
...@@ -24,7 +31,7 @@ public class TryWithResourceApp { ...@@ -24,7 +31,7 @@ public class TryWithResourceApp {
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Handling:"+e); log.info("Handling:"+e);
} }
} }
} }
...@@ -36,7 +43,7 @@ public class TryWithResourceApp { ...@@ -36,7 +43,7 @@ public class TryWithResourceApp {
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Handling:"+e); log.info("Handling:"+e);
} }
} }
public static void JDK9() public static void JDK9()
...@@ -48,7 +55,7 @@ public class TryWithResourceApp { ...@@ -48,7 +55,7 @@ public class TryWithResourceApp {
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Handling:"+e); log.info("Handling:"+e);
} }
} }
public static void multipleJDK9() public static void multipleJDK9()
...@@ -66,21 +73,23 @@ public class TryWithResourceApp { ...@@ -66,21 +73,23 @@ public class TryWithResourceApp {
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Handling:"+e); log.info("Handling:"+e);
} }
} }
public static void main(String[] args) public static void main(String[] args)
{ {
System.out.println("Program Execution With PreJDK7");
preJDK7();
System.out.println("Program Execution With JDK7"); log.info("Program Execution With PreJDK7");
JDK7();
preJDK7();
log.info("Program Execution With JDK7");
JDK7();
System.out.println("Program Execution With JDK9"); log.info("Program Execution With JDK9");
JDK9(); JDK9();
System.out.println("Program Execution Multiple Resources With JDK9"); log.info("Program Execution Multiple Resources With JDK9");
multipleJDK9(); multipleJDK9();
} }
} }
package com.nisum.java9Features.http2;
import com.nisum.java9Features.DiamondOperator.*;
import java.net.*;
import java.net.http.*;
import java.util.*;
import java.util.concurrent.*;
public class TestAsync {
public static void main(String[] args) throws Exception {
String url = "https://www.redbus.in/info/aboutus";
sendGetAsyncRequest(url);
}
public static void sendGetAsyncRequest(String url) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder(new URI(url)).GET().build();
System.out.println("Sending Asynchronous Request...");
CompletableFuture<HttpResponse<String>> cf = client.sendAsync(req, HttpResponse.BodyHandlers.ofString());
int count = 0;
while (!cf.isDone()) {
System.out.println("Processing not done and doing other activity:" + ++count);
}
processResponse(cf.get());
}
public static void processResponse(HttpResponse resp) {
System.out.println("Status Code:" + resp.statusCode());
//System.out.println("Response Body:"+resp.body());
HttpHeaders header = resp.headers();
Map<String, List<String>> map = header.map();
System.out.println("Response Headers");
map.forEach((k, v) -> System.out.println("\t" + k + ":" + v));
}
}
package com.nisum.java9Features.http2;
import java.net.*;
import java.net.http.*;
import java.nio.file.*;
import java.util.*;
public class TestSync {
public static void main(String[] args) throws Exception {
String url = "https://www.redbus.in/info/aboutus";
sendGetSyncRequest(url);
}
public static void sendGetSyncRequest(String url) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder(new URI(url)).GET().build();
HttpResponse resp = client.send(req, HttpResponse.BodyHandlers.ofString());
// HttpResponse resp1=client.send(req,HttpResponse.BodyHandlers.ofFile(Paths.get("abc.html")) );
processResponse(resp);
}
public static void processResponse(HttpResponse resp) {
System.out.println("Status Code:" + resp.statusCode());
//System.out.println("Response Body:" + resp.body());
HttpHeaders header = resp.headers();
Map<String, List<String>> map = header.map();
System.out.println("Response Headers");
map.forEach((k, v) -> System.out.println("\t" + k + ":" + v));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment