[java-opensaml COMMIT] in /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl: Met...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Oct 6 17:14:54 EDT 2016
Author: putmanb
Date: Thu Oct 6 17:14:54 2016
New Revision: 4519
URL: http://svn.shibboleth.net/view/java-opensaml?rev=4519&view=rev
Log:
Factor out c14 of indexable location URIs for reuse in multiple components.
Added:
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl/MetadataIndexSupport.java (with props)
Modified:
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl/SAMLArtifactMetadataIndex.java
Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl/SAMLArtifactMetadataIndex.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl/SAMLArtifactMetadataIndex.java?rev=4519&r1=4518&r2=4519&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl/SAMLArtifactMetadataIndex.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/impl/SAMLArtifactMetadataIndex.java Thu Oct 6 17:14:54 2016
@@ -60,8 +60,6 @@
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.collection.LazySet;
import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.net.SimpleURLCanonicalizer;
-import net.shibboleth.utilities.java.support.net.URLBuilder;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
@@ -368,7 +366,7 @@
location = Constraint.isNotNull(StringSupport.trimOrNull(sourceLocation),
"SAML artifact source location cannot be null or empty");
try {
- canonicalizedLocation = canonicalizeLocation(location);
+ canonicalizedLocation = MetadataIndexSupport.canonicalizeLocationURI(location);
} catch (MalformedURLException e) {
// This is unlikely to happen on realistic real world inputs. If it does, don't be fatal,
// just switch to alternate strategy.
@@ -437,22 +435,6 @@
return false;
}
- /**
- * Canonicalize the location to be indexed.
- *
- * @param url the location
- * @return the canonicalized location value to index
- * @throws MalformedURLException if URL can not be canonicalized
- */
- private String canonicalizeLocation(String url) throws MalformedURLException {
- URLBuilder urlBuilder = new URLBuilder(url);
- urlBuilder.setUsername(null);
- urlBuilder.setPassword(null);
- urlBuilder.getQueryParams().clear();
- urlBuilder.setFragment(null);
- return SimpleURLCanonicalizer.canonicalize(urlBuilder.buildURL());
- }
-
}
}
More information about the commits
mailing list