Commit 10694611 authored by Steinberg, Jan's avatar Steinberg, Jan

new integer value extraction process

parent bfd8acb2
......@@ -126,13 +126,13 @@ public class ContentResolver {
if ( possibleContentType.equals(ContentType.PDF) ) {
content = ContentHelpers.getTimeoutBackoffRetryAwareURLInputStream( new URL(url) );
}
else if (url.contains("10.1177/")) {
// GIGA journals special
String sageUrl = url;
String sageRedirectURLToPdf = sageUrl.replace("doi/10.1177", "doi/pdf/10.1177").replace("http://", "https://") + "?cookieSet=1";
URL sageURL = new URL(sageRedirectURLToPdf);
content = ContentHelpers.getTimeoutBackoffRetryAwareURLInputStream( sageURL );
}
// else if (url.contains("10.1177/")) {
// // GIGA journals special
// String sageUrl = url;
// String sageRedirectURLToPdf = sageUrl.replace("doi/10.1177", "doi/pdf/10.1177").replace("http://", "https://") + "?cookieSet=1";
// URL sageURL = new URL(sageRedirectURLToPdf);
// content = ContentHelpers.getTimeoutBackoffRetryAwareURLInputStream( sageURL );
// }
else if ( possibleContentType.equals(ContentType.HTML)
|| possibleContentType.equals(ContentType.XHTML)
|| possibleContentType.equals(ContentType.XML) ) {
......@@ -297,6 +297,7 @@ public class ContentResolver {
String resolvedUrlString = ContentHelpers.resolvePossibleRedirects(urlString);
// BEGIN detect content type
log.info("");
URL resolvedUrl = new URL(resolvedUrlString);
InputStream possibleContent = ContentHelpers.getTimeoutBackoffRetryAwareURLInputStream(resolvedUrl);
ContentInfo possibleContentInfo = ContentHelpers.CONTENT_INFO_UTIL.findMatch(possibleContent);
......
......@@ -178,6 +178,7 @@ public class SmartExcelSheetBundlesSetSource implements BundlesSetSource {
case "ssoar.licence.dfg": result = extractBinaryMetadatum(metadatumKey, cell, "true", null); break;
case "ssoar.wgl.collection": result = extractBinaryMetadatum(metadatumKey, cell, "true", null); break;
case "ssoar.urn.registration": result = extractCleanedMetadatum(metadatumKey, cell); break;
case "internal.status": result = extractIntegerMetadatum(metadatumKey, cell); break;
default: result = new HashSet<>();
}
}
......@@ -258,8 +259,9 @@ public class SmartExcelSheetBundlesSetSource implements BundlesSetSource {
Metadatum metadatum;
try {
//int intValue = (int) Double.parseDouble(rawValue);
int intValue = Integer.parseInt(rawValue.trim());
String intString = Integer.toString(intValue);
double dblValue= Double.parseDouble(rawValue.trim());
//int intValue = Integer.parseInt(rawValue.trim());
String intString = Double.toString(dblValue);
if (intString.contains(".0")) {
intString = intString.replace(".0", "");
}
......
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