/** * Join a collection of Strings together using the specified separator. * * @param parts * Strings to join * @param separator * used to join * @return a String with all the joined parts */ public static String join(Collection<String> parts, String separator) { return StringUtils.join(parts, separator, separator); }
private static String joinNames(List<String> names, String singular, String plural) { if (names.size() == 1) return singular + " " + names.get(0); //$NON-NLS-1$ else return plural + " " + StringUtils.join(names, ", ", " and "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
/** * Join a collection of Strings together using the specified separator. * * @param parts * Strings to join * @param separator * used to join * @return a String with all the joined parts */ public static String join(Collection<String> parts, String separator) { return StringUtils.join(parts, separator, separator); }
/** * Join a collection of Strings together using the specified separator. * * @param parts * Strings to join * @param separator * used to join * @return a String with all the joined parts */ public static String join(Collection<String> parts, String separator) { return StringUtils.join(parts, separator, separator); }
private static String joinNames(List<String> names, String singular, String plural) { if (names.size() == 1) return singular + " " + names.get(0); //$NON-NLS-1$ else return plural + " " + StringUtils.join(names, ", ", " and "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
private static String joinNames(List<String> names, String singular, String plural) { if (names.size() == 1) return singular + " " + names.get(0); //$NON-NLS-1$ else return plural + " " + StringUtils.join(names, ", ", " and "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
public static String getAuthRequestUrl() { return String.format(GITHUB_AUTH_URL, StringUtils.join(Arrays.asList(GITHUB_WANTED_SCOPES), "%20"), SlAppSettings.GITHUB_CLIENT_ID); }
/** * Purge the coordinators in SOME order in batches of size 'limit' (its in reverse order only for convenience) * * @param coords List of coordinators to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeCoordinators(List<String> coords) throws JPAExecutorException { coordDel += coords.size(); for (int startIndex = 0; startIndex < coords.size(); ) { int endIndex = (startIndex + limit < coords.size()) ? (startIndex + limit) : coords.size(); List<String> coordsForDelete = coords.subList(startIndex, endIndex); LOG.debug("Deleting coordinators: " + StringUtils.join(coordsForDelete, ",")); jpaService.execute(new CoordJobsDeleteJPAExecutor(coordsForDelete)); startIndex = endIndex; } }
/** * Purge coordActions of long running coordinators and purge them * * @param coordActions List of coordActions to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeCoordActions(List<String> coordActions) throws JPAExecutorException { coordActionDel = coordActions.size(); for (int startIndex = 0; startIndex < coordActions.size(); ) { int endIndex = (startIndex + limit < coordActions.size()) ? (startIndex + limit) : coordActions.size(); List<String> coordActionsForDelete = coordActions.subList(startIndex, endIndex); LOG.debug("Deleting coordinator actions: " + StringUtils.join(coordActionsForDelete, ",")); jpaService.execute(new CoordActionsDeleteJPAExecutor(coordActionsForDelete)); startIndex = endIndex; } } /**
/** * Purge the workflows in REVERSE order in batches of size 'limit' (this must be done in reverse order so that children are * purged before their parents) * * @param wfs List of workflows to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeWorkflows(List<String> wfs) throws JPAExecutorException { wfDel += wfs.size(); //To delete sub-workflows before deleting parent workflows Collections.reverse(wfs); for (int startIndex = 0; startIndex < wfs.size(); ) { int endIndex = (startIndex + limit < wfs.size()) ? (startIndex + limit) : wfs.size(); List<String> wfsForDelete = wfs.subList(startIndex, endIndex); LOG.debug("Deleting workflows: " + StringUtils.join(wfsForDelete, ",")); jpaService.execute(new WorkflowJobsDeleteJPAExecutor(wfsForDelete)); startIndex = endIndex; } }
/** * Purge the bundles in SOME order in batches of size 'limit' (its in reverse order only for convenience) * * @param bundles List of bundles to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeBundles(List<String> bundles) throws JPAExecutorException { bundleDel += bundles.size(); for (int startIndex = 0; startIndex < bundles.size(); ) { int endIndex = (startIndex + limit < bundles.size()) ? (startIndex + limit) : bundles.size(); Collection<String> bundlesForDelete = bundles.subList(startIndex, endIndex); LOG.debug("Deleting bundles: " + StringUtils.join(bundlesForDelete, ",")); jpaService.execute(new BundleJobsDeleteJPAExecutor(bundlesForDelete)); startIndex = endIndex; } }
/** * Purge coordActions of long running coordinators and purge them * * @param coordActions List of coordActions to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeCoordActions(List<String> coordActions) throws JPAExecutorException { coordActionDel = coordActions.size(); for (int startIndex = 0; startIndex < coordActions.size(); ) { int endIndex = (startIndex + limit < coordActions.size()) ? (startIndex + limit) : coordActions.size(); List<String> coordActionsForDelete = coordActions.subList(startIndex, endIndex); LOG.debug("Deleting coordinator actions: " + StringUtils.join(coordActionsForDelete, ",")); jpaService.execute(new CoordActionsDeleteJPAExecutor(coordActionsForDelete)); startIndex = endIndex; } } /**
/** * Purge the bundles in SOME order in batches of size 'limit' (its in reverse order only for convenience) * * @param bundles List of bundles to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeBundles(List<String> bundles) throws JPAExecutorException { bundleDel += bundles.size(); for (int startIndex = 0; startIndex < bundles.size(); ) { int endIndex = (startIndex + limit < bundles.size()) ? (startIndex + limit) : bundles.size(); Collection<String> bundlesForDelete = bundles.subList(startIndex, endIndex); LOG.debug("Deleting bundles: " + StringUtils.join(bundlesForDelete, ",")); jpaService.execute(new BundleJobsDeleteJPAExecutor(bundlesForDelete)); startIndex = endIndex; } }
/** * Purge the coordinators in SOME order in batches of size 'limit' (its in reverse order only for convenience) * * @param coords List of coordinators to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeCoordinators(List<String> coords) throws JPAExecutorException { coordDel += coords.size(); for (int startIndex = 0; startIndex < coords.size(); ) { int endIndex = (startIndex + limit < coords.size()) ? (startIndex + limit) : coords.size(); List<String> coordsForDelete = coords.subList(startIndex, endIndex); LOG.debug("Deleting coordinators: " + StringUtils.join(coordsForDelete, ",")); jpaService.execute(new CoordJobsDeleteJPAExecutor(coordsForDelete)); startIndex = endIndex; } }
/** * Purge the workflows in REVERSE order in batches of size 'limit' (this must be done in reverse order so that children are * purged before their parents) * * @param wfs List of workflows to purge * @throws JPAExecutorException If a JPA executor has a problem */ private void purgeWorkflows(List<String> wfs) throws JPAExecutorException { wfDel += wfs.size(); //To delete sub-workflows before deleting parent workflows Collections.reverse(wfs); for (int startIndex = 0; startIndex < wfs.size(); ) { int endIndex = (startIndex + limit < wfs.size()) ? (startIndex + limit) : wfs.size(); List<String> wfsForDelete = wfs.subList(startIndex, endIndex); LOG.debug("Deleting workflows: " + StringUtils.join(wfsForDelete, ",")); jpaService.execute(new WorkflowJobsDeleteJPAExecutor(wfsForDelete)); startIndex = endIndex; } }
ArrayList<String> names = new ArrayList<String>(conflictingNames); Collections.sort(names); String joined = StringUtils.join(names, ", "); //$NON-NLS-1$ return NLS.bind( UIText.ValidationUtils_RefNameConflictsWithExistingMessage,