-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: various minor improvements / patches for IATP
- Loading branch information
1 parent
a3ef0f1
commit d1e6f37
Showing
4 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
core/common/util/src/main/java/org/eclipse/edc/util/uri/UriUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.util.uri; | ||
|
||
import java.net.URI; | ||
|
||
public class UriUtils { | ||
public static boolean equalsIgnoreFragment(URI u1, URI u2) { | ||
var str1 = stripFragment(u1.toString()); | ||
var str2 = stripFragment(u2.toString()); | ||
|
||
return str1.equals(str2); | ||
} | ||
|
||
public static String stripFragment(String string) { | ||
var ix = string.indexOf("#"); | ||
return ix >= 0 ? string.substring(0, ix) : string; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters