Commit fc92b70f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

chemical connector uses api over ssl and due to change of http response status...

chemical connector uses api over ssl and due to change of http response status error handling slightly changed
parent 7c12bf87
......@@ -57,18 +57,18 @@ public class ChemicalParser extends CachableInterface implements IExternalServic
/**
* Homepage of drugbank.
*/
static final String URL = "http://ctdbase.org/";
static final String URL = "https://ctdbase.org/";
/**
* URL to get a list of chemicals by disease id.
*/
public static final String DISEASE_URL = "http://ctdbase.org/detail.go?6578706f7274=1&d-1332398-e=5&view=chem&"
public static final String DISEASE_URL = "https://ctdbase.org/detail.go?6578706f7274=1&d-1332398-e=5&view=chem&"
+ "type=disease&acc=MESH%3A";
/**
* URL to get a list of chemicals by gene id.
*/
public static final String DISEASE_GENE_URL = "http://ctdbase.org/detail.go?slimTerm=all&6578706f7274=1&qid=3464576&"
public static final String DISEASE_GENE_URL = "https://ctdbase.org/detail.go?slimTerm=all&6578706f7274=1&qid=3464576&"
+ "d-1332398-e=5&view=disease&type=gene&assnType=curated&acc=";
/**
......@@ -218,7 +218,7 @@ public class ChemicalParser extends CachableInterface implements IExternalServic
}
}
} catch (FileNotFoundException e) {
} catch (WrongResponseCodeIOException e) {
// it means that there are no results for this query
} catch (IOException e) {
throw new ChemicalSearchException("ctdbase service unavailable", e);
......@@ -447,14 +447,14 @@ public class ChemicalParser extends CachableInterface implements IExternalServic
if (entrez == null) {
invalidHgnc.add(md);
} else {
String query = "http://ctdbase.org/detail.go?type=gene&view=ixn&chemAcc=" + chemID.getResource() + "&acc=" + entrez.getResource();
String query = "https://ctdbase.org/detail.go?type=gene&view=ixn&chemAcc=" + chemID.getResource() + "&acc=" + entrez.getResource();
String referencesPage = getWebPageContent(query);
Matcher matcher = pattern.matcher(referencesPage);
while (matcher.find()) {
idx.add(matcher.group(1));
}
for (String string : idx) {
String query2 = "http://ctdbase.org/detail.go?6578706f7274=1&d-1340579-e=5&type=relationship&ixnId=" + string;
String query2 = "https://ctdbase.org/detail.go?6578706f7274=1&d-1340579-e=5&type=relationship&ixnId=" + string;
String referencesPage2 = getWebPageContent(query2);
String[] lines = referencesPage2.split("\n");
for (int i = 1; i < lines.length; i++) {
......
......@@ -551,7 +551,7 @@ public class ChemicalParserTest extends AnnotationTestFunctions {
// remove info about single publication from cache (so we will have to
// download it)
chemicalParser.getCache().removeByQuery(
"http://ctdbase.org/detail.go?6578706f7274=1&d-1340579-e=5&type=relationship&ixnId=4802115", chemicalParser.getCacheType());
"https://ctdbase.org/detail.go?6578706f7274=1&d-1340579-e=5&type=relationship&ixnId=4802115", chemicalParser.getCacheType());
// disallow to use cache for first query (it will be directly about drug),
// so parser will have to parse results taking data from cache (or
......
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