- Fix not setting the right "Error"-members when the docUrl was found, but the full-text was not retrieved.
- Set a "couldRetry"-indication in the "Error"-class, when the full-text was retrieved, as, in general, it could be retried to give the same successful result.
- Update the "docFileNotRetrieved"-check to use the standardized string.
- Eliminate some possible NPEs.
- Update Gradle.
@ -136,8 +135,6 @@ public class PublicationsRetrieverPlugin {
}
privatestaticfinalStringDocFileNotRetrievedExceptionName=DocFileNotRetrievedException.class.getSimpleName();// Keep it here for easily spot if the exception changes inside the PublicationsRetriever library.
publicstaticvoidaddUrlReportsToWorkerReport()
{
Timestamptimestamp=newTimestamp(System.currentTimeMillis());// Store it here, in order to have the same for all current records.
@ -149,7 +146,7 @@ public class PublicationsRetrieverPlugin {
@ -168,15 +165,18 @@ public class PublicationsRetrieverPlugin {
}
// TODO - The case where the "twin-ID" is not found, should "never" happen. But should we check? How to handle if that is the case..?
}
elseif(!comment.contains(DocFileNotRetrievedExceptionName)){// If it was downloaded without an error.
elseif(!comment.equals(HttpConnUtils.docFileNotRetrievedMessage)){// If it was downloaded without an error.
fileLocation=comment;// This is the full-file-path.
mimeType="application/pdf";
}
error=newError(null,null);// We do not want to send a "null" object, since it just adds more complicated handling in the controller..
}else// Else the file was not retrieved, so all file-related data are kept "null".
error=newError(Error.ErrorType.couldRetry,comment);// We can still try to download it in the future.
if(error==null)// If the file was retrieved, in any time.
error=newError(Error.ErrorType.couldRetry,null);// We do not want to send a "null" object, since it just adds more complicated handling in the controller..