Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
TreeApi
Commits
8d154f8e
Commit
8d154f8e
authored
Feb 09, 2022
by
Benedikt Heinrichs
Browse files
Fix: Custom Uri for dotNetRDF (coscine/issues#1912)
parent
682f7f96
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Tree/Controllers/TreeController.cs
View file @
8d154f8e
using
Coscine.Api.Tree.Util
;
using
Coscine.ApiCommons
;
using
Coscine.ApiCommons.Factories
;
using
Coscine.Configuration
;
...
...
@@ -74,7 +75,7 @@ namespace Coscine.Api.Tree.Controllers
/// <returns> Uri </returns>
public
Uri
GenerateId
(
string
resourceId
,
string
path
)
{
return
new
Uri
(
$"https://hdl.handle.net/
{
_prefix
}
/
{
resourceId
}
@path=
{
Uri
.
EscapeDataString
(
path
)}
"
);
return
new
Custom
Uri
(
$"https://hdl.handle.net/
{
_prefix
}
/
{
resourceId
}
@path=
{
Uri
.
EscapeDataString
(
path
)}
"
);
}
/// <summary>
...
...
src/Tree/Util/CustomUri.cs
0 → 100644
View file @
8d154f8e
using
System
;
namespace
Coscine.Api.Tree.Util
{
/// <summary>
/// Adapts the returned ToString of a Uri
/// </summary>
public
class
CustomUri
:
Uri
{
/// <summary>
/// Constructs a Custom Uri
/// </summary>
/// <param name="uri"></param>
public
CustomUri
(
string
uri
)
:
base
(
uri
)
{
}
/// <summary>
/// Overwrites the ToString for returning the AbsoluteUri (for dotNetRDF)
/// </summary>
/// <returns></returns>
public
override
string
ToString
()
{
return
AbsoluteUri
;
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment