if ( StringUtils.equals( relativePath, "." ) )
@Override public boolean accepts( Event<?> evt ) { final String simpleName = evt.getClass().getName(); // TODO: nexus-proxy module does not reference plugin manager, so this is a quick'n'dirty workaround for now return evt instanceof NexusInitializedEvent // for core || StringUtils.equals( simpleName, "org.sonatype.nexus.plugins.events.PluginActivatedEvent" ) // for plugin loaded || StringUtils.equals( simpleName, "org.sonatype.nexus.plugins.events.PluginDeactivatedEvent" ); // for plugin unloaded }
/** * Return a list of any processes where the command exactly matches the command passed in. */ public static List<UnixProcess> getMatchingProcesses(List<UnixProcess> processes, String command) { List<UnixProcess> matches = new ArrayList<UnixProcess>(); for (UnixProcess process : processes) { if (StringUtils.equals(process.getCommand(), command)) { matches.add(process); } } return matches; }
/** * Checks if principal is creator of document. * * @param doc * @param principal * @return true if principal is creator of document * @throws DocumentException */ protected boolean isCreator(Document doc, Principal principal) throws DocumentException { String creator = (String) doc.getPropertyValue("dc:creator"); return StringUtils.equals(principal.getName(), creator); }
public boolean equals (Object object) { if (object == null || !(object instanceof Archetype) ) { return false; } else { Archetype a = (Archetype) object; return org.codehaus.plexus.util.StringUtils.equals( groupId, a.getGroupId () ) && org.codehaus.plexus.util.StringUtils.equals( artifactId, a.getArtifactId () ); } }
private boolean isDirty() { for(Entry<String, String> original : originalValues.entrySet()) { if(!StringUtils.equals(original.getValue(), getPreferenceStore().getString(original.getKey()))) { return true; } } return false; } }
public String getPropertyValue(final String propertyName, final Map<String, String> propElements) { String propertyValue = Objects.firstNonNull(properties.getProperty(propertyName), ""); for (Map.Entry<String, String> entry : propElements.entrySet()) { final String key = "#{" + entry.getKey() + "}"; propertyValue = StringUtils.replace(propertyValue, key, entry.getValue()); } // Replace all remaining groups. final String result = propertyValue.replaceAll("\\#\\{.*\\}", ""); IWFEnum.checkState(getOnMissingProperty(), StringUtils.equals(propertyValue, result), "property"); return result; } }
@SuppressWarnings("unchecked") protected PackageConfig findPackageNamespace( Configuration xwConfig, String name ) { Map<?,PackageConfig> xwPackageConfigMap = xwConfig.getPackageConfigs(); for ( PackageConfig xwPackageConfig : xwPackageConfigMap.values() ) { if ( StringUtils.equals( name, xwPackageConfig.getNamespace() ) ) { return xwPackageConfig; } } return null; }
private static SnapshotVersion get( SnapshotVersion s1, List<SnapshotVersion> snapshotVersions ) { for ( SnapshotVersion s2 : snapshotVersions ) { if ( StringUtils.equals( s1.getClassifier(), s2.getClassifier() ) && StringUtils.equals( s1.getExtension(), s2.getExtension() ) ) { return s2; } } return null; }
private boolean anyProvidedDependencyRequiresEE(MuleArtifactContentResolver muleArtifactContentResolver) { return muleArtifactContentResolver.getPom().getDependencies().stream() .filter(coordinates -> StringUtils.equals(coordinates.getScope(), "provided")) .anyMatch(coordinates -> coordinates.getGroupId().startsWith("com.mulesoft.mule")); }
public static List<String> getIncludes(Environment env, String key, String defaultValue) { String includes = SpringUtils.getProperty(env, key, defaultValue); if (NullUtils.isNull(includes) || StringUtils.equals(includes, Constants.WILDCARD)) { return new ArrayList<String>(); } else { return CollectionUtils.getTrimmedListFromCSV(includes); } }
public static SnapshotVersion searchForEquivalent( SnapshotVersion source, List<SnapshotVersion> list ) { for ( SnapshotVersion equivalent : list ) { if ( StringUtils.equals( source.getExtension(), equivalent.getExtension() ) && ( ( StringUtils.isEmpty( source.getClassifier() ) && StringUtils.isEmpty( equivalent.getClassifier() ) ) || StringUtils.equals( source.getClassifier(), equivalent.getClassifier() ) ) ) { return equivalent; } } return null; }
private CUserRoleMapping readCUserRoleMapping( String userId, String source ) throws NoSuchRoleMappingException { for ( CUserRoleMapping userRoleMapping : (List<CUserRoleMapping>) getConfiguration().getUserRoleMappings() ) { if ( StringUtils.equals( userRoleMapping.getUserId(), userId ) && StringUtils.equals( userRoleMapping.getSource(), source )) { return userRoleMapping; } } throw new NoSuchRoleMappingException( "No User Role Mapping for user: " + userId ); }
protected boolean isRecordedEvent(final NexusAuthenticationEvent nae) { // we record everything except anonymous related ones if (StringUtils.equals(nexusConfiguration.getAnonymousUsername(), nae.getClientInfo().getUserid())) { return false; } // if here, we record the event if not similar to previous one return !isSimilarEvent(nae); }
protected boolean isRecordedEvent(final NexusAuthorizationEvent nae) { // we record only authz failures if (nae.isSuccessful()) { return false; } // we record everything except anonymous related ones if (StringUtils.equals(nexusConfiguration.getAnonymousUsername(), nae.getClientInfo().getUserid())) { return false; } // if here, we record the event if not similar to previous one return !isSimilarEvent(nae); }