private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(fileToLoad, orcid)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(fileToLoad, orcid)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(orcid, orcidsToDelete)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(workId, worksToDelete)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(clientDetailsId, doAll, clientIdsFile)) { throw new CmdLineException(parser, "At least one of -c | -a | -f must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(fileToLoad, orcid)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(fileToLoad, orcid)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(fileToLoad, singleOrcidToProcess)) { throw new CmdLineException(parser, "At least one of -f | -o must be specificed"); } }
private void validateArgs(CmdLineParser parser) throws CmdLineException { if (NullUtils.allNull(zipFile, directory)) { throw new CmdLineException(parser, "One of -f | -d must be specificed"); } if(zipFile != null && !zipFile.exists()) { throw new CmdLineException(parser, "Couldn't find the zip file at: " + zipFile.getPath()); } if(directory != null && (!directory.exists() || !directory.isDirectory()) ) { throw new CmdLineException(parser, "Couldn't find the directory at: " + directory.getPath()); } }
private void validateArgs(CmdLineParser parser) throws Exception { if (NullUtils.allNull(outputFileName)) { throw new CmdLineException(parser, "You must specify a file name"); } // prefer processing single orcid if both are passed, don't accidentally hit DB needlessly if (orcid != null) { orcidsToQuery = new ArrayList<String>(Arrays.asList(new String[] { orcid })); } else if (inputFileName != null) { orcidsToQuery = FileUtils.readLines(new File(inputFileName)); } else { throw new CmdLineException(parser, "You must specify either a single orcid or provide an input name"); } }
private OrcidActivities getOrcidActivities(ProfileEntity profileEntity, boolean loadNewAffiliationTypes) { Affiliations affiliations = getAffiliations(profileEntity, loadNewAffiliationTypes); FundingList fundings = getFundingList(profileEntity); OrcidWorks orcidWorks = getOrcidWorks(profileEntity); if (NullUtils.allNull(fundings, orcidWorks, affiliations)) { return null; } OrcidActivities orcidActivities = new OrcidActivities(); orcidActivities.setFundings(fundings); orcidActivities.setOrcidWorks(orcidWorks); orcidActivities.setAffiliations(affiliations); return orcidActivities; }
private OrganizationAddress getAddress(OrgEntity orgEntity) { if (orgEntity != null) { String city = orgEntity.getCity(); String region = orgEntity.getRegion(); Iso3166Country country = Iso3166Country.valueOf(orgEntity.getCountry()); if (!NullUtils.allNull(city, region, country)) { OrganizationAddress address = new OrganizationAddress(); address.setCity(city); address.setRegion(region); address.setCountry(country); return address; } } return null; }