File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/java/com/bhyoo/onedrive/container Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1414import java .net .MalformedURLException ;
1515import java .net .URL ;
1616
17+ import static io .netty .handler .codec .http .HttpHeaderNames .ACCEPT ;
1718import static io .netty .handler .codec .http .HttpHeaderNames .ACCEPT_ENCODING ;
19+ import static io .netty .handler .codec .http .HttpHeaderValues .APPLICATION_JSON ;
1820import static io .netty .handler .codec .http .HttpHeaderValues .GZIP ;
1921
2022/**
@@ -37,9 +39,12 @@ public AsyncJobMonitor(@NotNull String url) {
3739
3840 @ SneakyThrows (MalformedURLException .class )
3941 public AsyncJobMonitor update () {
40- SyncResponse response = new SyncRequest (new URL (this .url )).setHeader (ACCEPT_ENCODING , GZIP ).doGet ();
42+ SyncResponse response = new SyncRequest (new URL (this .url ))
43+ .setHeader (ACCEPT , APPLICATION_JSON )
44+ .setHeader (ACCEPT_ENCODING , GZIP )
45+ .doGet ();
4146
42- // TODO: handle error response
47+ // TODO: error handling
4348
4449 try {
4550 JsonParser parser = RequestTool .jsonFactory .createParser (response .getContent ());
@@ -65,6 +70,9 @@ public AsyncJobMonitor update() {
6570 case "statusDescription" :
6671 statusDescription = parser .getText ();
6772 break ;
73+ case "@odata.context" :
74+ // TODO
75+ break ;
6876 default :
6977 throw new IllegalStateException (
7078 "Unknown attribute detected in AsyncJobMonitor : " + currentName );
You can’t perform that action at this time.
0 commit comments