Skip to content

Commit

Permalink
server: Modify putTrace to support empty name
Browse files Browse the repository at this point in the history
In the TSP the name parameter is not required, so the
TraceManagerServer should support it.

Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
Change-Id: I1d70d4b2e3eb4fb91e8572f9bafec8c590f00c67
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/197644
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
arfio authored and bhufmann committed Dec 15, 2022
1 parent 503b7e3 commit ee27a86
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -201,8 +201,9 @@ private static Response put(String path, String name, String typeID)
return Response.status(Status.NOT_IMPLEMENTED).entity(NOT_SUPPORTED).build();
}
String traceType = traceTypes.get(0).getTraceTypeId();
String traceName = name == null ? Paths.get(path).getFileName().toString() : name;

IResource resource = getResource(path, name);
IResource resource = getResource(path, traceName);
if (!resource.exists()) {
if (!createResource(path, resource)) {
return Response.status(Status.INTERNAL_SERVER_ERROR).entity(TRACE_CREATION_FAILED).build();
Expand Down

0 comments on commit ee27a86

Please sign in to comment.