-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit a7190d2.
- Loading branch information
1 parent
a7190d2
commit ce1a574
Showing
23 changed files
with
205 additions
and
244 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
22 changes: 12 additions & 10 deletions
22
plugin/src/main/java/io/snyk/eclipse/plugin/utils/LsMetadataResponseHandler.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
package io.snyk.eclipse.plugin.utils; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import io.snyk.languageserver.download.LsMetadata; | ||
import org.apache.http.HttpResponse; | ||
import org.apache.http.client.ResponseHandler; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.nio.charset.Charset; | ||
|
||
import org.apache.http.HttpResponse; | ||
import org.apache.http.client.ResponseHandler; | ||
|
||
public class LsMetadataResponseHandler implements ResponseHandler<LsMetadata> { | ||
private final ObjectMapper om = new ObjectMapper(); | ||
public class LsMetadataResponseHandler implements ResponseHandler<String> { | ||
|
||
public LsMetadataResponseHandler() { | ||
} | ||
|
||
@Override | ||
public LsMetadata handleResponse(HttpResponse httpResponse) { | ||
try (InputStream inputStream = httpResponse.getEntity().getContent()) { | ||
return om.readValue(inputStream, LsMetadata.class); | ||
public String handleResponse(HttpResponse httpResponse) { | ||
String latestCliSupportingLSProtocolVersion = "10"; | ||
InputStream inputStream; | ||
try { | ||
inputStream = httpResponse.getEntity().getContent(); | ||
latestCliSupportingLSProtocolVersion = new String(inputStream.readAllBytes(), Charset.defaultCharset()); | ||
} catch (UnsupportedOperationException | IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
return latestCliSupportingLSProtocolVersion; | ||
} | ||
} |
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
Oops, something went wrong.