Skip to content

Commit 5fa6de4

Browse files
author
Benjamin Geer
authored
chore: Remove obsolete functions from StringFormatter. (#1640)
1 parent 683a3ed commit 5fa6de4

1 file changed

Lines changed: 0 additions & 48 deletions

File tree

‎webapi/src/main/scala/org/knora/webapi/util/StringFormatter.scala‎

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,25 +2345,6 @@ class StringFormatter private(val maybeSettings: Option[SettingsImpl] = None, ma
23452345
}
23462346
}
23472347

2348-
/**
2349-
* Checks that a string represents a valid path for a `knora-base:Map`. A valid path must be a sequence of names
2350-
* separated by slashes (`/`). Each name must be a valid XML
2351-
* [[https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName NCName]].
2352-
*
2353-
* @param mapPath the path to be checked.
2354-
* @param errorFun a function that throws an exception. It will be called if the path is invalid.
2355-
* @return the same path.
2356-
*/
2357-
def validateMapPath(mapPath: String, errorFun: => Nothing): String = {
2358-
val splitPath: Array[String] = mapPath.split('/')
2359-
2360-
for (name <- splitPath) {
2361-
validateNCName(name, errorFun)
2362-
}
2363-
2364-
mapPath
2365-
}
2366-
23672348
/**
23682349
* Determines whether a URL path refers to a built-in API v2 ontology (simple or complex).
23692350
*
@@ -3021,35 +3002,6 @@ class StringFormatter private(val maybeSettings: Option[SettingsImpl] = None, ma
30213002
s"http://$IriDomain/permissions/$shortcode/$knoraPermissionUuid"
30223003
}
30233004

3024-
/**
3025-
* Creates an IRI for a `knora-base:Map`.
3026-
*
3027-
* @param mapPath the map's path, which must be a sequence of names separated by slashes (`/`). Each name must
3028-
* be a valid XML [[https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName NCName]].
3029-
* @return the IRI of the map.
3030-
*/
3031-
def makeMapIri(mapPath: String): IRI = {
3032-
s"http://$IriDomain/maps/$mapPath"
3033-
}
3034-
3035-
/**
3036-
* Extracts the path of a persistent map from the IRI of a `knora-base:Map`.
3037-
*
3038-
* @param mapIri the IRI of the `knora-base:Map`.
3039-
* @return the map's path.
3040-
*/
3041-
def mapIriToMapPath(mapIri: IRI): String = {
3042-
mapIri.stripPrefix(s"http://$IriDomain/maps/")
3043-
}
3044-
3045-
/**
3046-
* Creates a random IRI for a `knora-base:MapEntry`.
3047-
*/
3048-
def makeRandomMapEntryIri: IRI = {
3049-
val mapEntryUuid = makeRandomBase64EncodedUuid
3050-
s"http://$IriDomain/map-entries/$mapEntryUuid"
3051-
}
3052-
30533005
/**
30543006
* Converts a camel-case string like `FooBar` into a string like `foo-bar`.
30553007
*

0 commit comments

Comments
 (0)