Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<dependency-check-maven.version>12.1.8</dependency-check-maven.version>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.17</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
5 changes: 3 additions & 2 deletions src/org/spdx/crossref/Live.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ public static boolean urlLinkExists(String URLName){
// fake request coming from browser
con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36");
con.setRequestMethod("HEAD");
con.setConnectTimeout(8500);
con.setConnectTimeout(30000);
con.setReadTimeout(30000);
int responseCode = con.getResponseCode();
return (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NOT_MODIFIED
|| responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP);
} catch (UnknownHostException e) {
return false;
} catch (Exception e) {
logger.warn("Failed checking live status.",e.getMessage());
logger.warn("Failed checking live status for URL {}: {}", URLName, e.getMessage());
return false;
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/org/spdx/crossref/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ public Match(String url, SpdxListedLicense license) {
*/
public static String checkMatch(String url, SpdxListedLicense license){
try {
Document doc = Jsoup.connect(url).get();
Document doc = Jsoup.connect(url).timeout(30000).get();
String bodyText = doc.body().text();
return String.valueOf(LicenseCompareHelper.isStandardLicenseWithinText(bodyText, license));
} catch (IOException e) {
logger.warn("IO exception comparing license text for license ID "+license.getLicenseId()+" and URL "+url);
logger.warn("IO exception comparing license text for license ID {} and URL {}: {}", url,
license.getLicenseId(), e.getMessage());
return String.valueOf(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public synchronized ListedLicenseContainer next() {

ListedLicenseContainer retval = readyLicense.getKey();
try {
for (CrossRef crossRef:readyLicense.getValue().get(2, TimeUnit.MINUTES)) {
for (CrossRef crossRef:readyLicense.getValue().get(5, TimeUnit.MINUTES)) {
retval.getV2ListedLicense().getCrossRef().add(crossRef);
}

Expand Down