Skip to content

Commit

Permalink
Fixing again proxy... in the case there is no proxy
Browse files Browse the repository at this point in the history
Former-commit-id: b05734f
  • Loading branch information
kermitt2 committed Nov 24, 2018
1 parent 4e02dc7 commit e677663
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ project(":grobid-trainer") {
// run like:
// gradle PubMedCentralEval -Pp2t=/path/to/goldenSet
// gradle PubMedCentralEval -Pp2t=/path/to/goldenSet -Prun=1 -PfileRatio=0.1
// ./gradlew EvaluationDOIMatching build -Pp2t=ABS_PATH_TO_PMC/PMC_sample_1943
// ./gradlew EvaluationDOIMatching eval -Pp2t=ABS_PATH_TO_PMC/PMC_sample_1943
// ./gradlew PrepareDOIMatching -Pp2t=ABS_PATH_TO_PMC/PMC_sample_1943
// ./gradlew EvaluateDOIMatching -Pp2t=ABS_PATH_TO_PMC/PMC_sample_1943
task(PubMedCentralEval, dependsOn: 'classes', type: JavaExec, group: 'modelevaluation') {
main = 'org.grobid.trainer.evaluation.EndToEndEvaluation'
classpath = sourceSets.main.runtimeClasspath
Expand All @@ -396,7 +396,7 @@ project(":grobid-trainer") {
jvmArgs '-Xmx3072m'
}

task(EvaluationDOIMatching, dependsOn: 'classes', type: JavaExec, group: 'modelevaluation') {
task(EvaluateDOIMatching, dependsOn: 'classes', type: JavaExec, group: 'modelevaluation') {
main = 'org.grobid.trainer.evaluation.EvaluationDOIMatching'
classpath = sourceSets.main.runtimeClasspath
args 'eval', getArg('p2t', '.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* to load grobid-properties from a property file. Each property will be copied
* to a system property having the same name.
*
* @author Florian Zipser
* @author Florian Zipser, Patrice
* @version 1.2
*/
public class GrobidProperties {
Expand Down Expand Up @@ -496,7 +496,10 @@ public static void setCrossrefPort(final String port) {
* @return host for connecting crossref
*/
public static String getProxyHost() {
return getPropertyValue(GrobidPropertyKeys.PROP_PROXY_HOST);
String val = getPropertyValue(GrobidPropertyKeys.PROP_PROXY_HOST);
if (val != null && val.equals("null"))
val = null;
return val;
}

/**
Expand All @@ -517,7 +520,13 @@ public static void setProxyHost(final String host) {
* @return port for connecting crossref
*/
public static Integer getProxyPort() {
return Integer.valueOf(getPropertyValue(GrobidPropertyKeys.PROP_PROXY_PORT));
String val = getPropertyValue(GrobidPropertyKeys.PROP_PROXY_PORT);
if (val != null && val.equals("null"))
val = null;
if (val == null)
return null;
else
return Integer.valueOf(val);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public class CrossrefRequest<T extends Object> extends Observable {

protected static final String BASE_URL = "http://api.crossref.org";
protected static final String BASE_URL = "https://api.crossref.org";

/**
* Model key in crossref, ex: "works", "journals"..
Expand Down

0 comments on commit e677663

Please sign in to comment.