Commits (4)
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 CustomUri($"https://hdl.handle.net/{_prefix}/{resourceId}@path={Uri.EscapeDataString(path)}");
}
/// <summary>
......
......@@ -5,7 +5,7 @@
<AssemblyName>Coscine.Api.Tree</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net5.0</TargetFramework>
<Version>2.5.1</Version>
<Version>2.5.2</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......
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;
}
}
}