package me.izstas.rfs.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import me.izstas.rfs.server.config.web.PathWithinPattern;
import me.izstas.rfs.server.model.Metadata;
import me.izstas.rfs.server.service.MetadataService;

@RestController
@RequestMapping("/metadata/**")
public class MetadataController {
    @Autowired
    private MetadataService metadataService;

    @RequestMapping(method = RequestMethod.GET)
    public Metadata getMetadata(@PathWithinPattern String path) {
        return metadataService.getMetadataFromUserPath(path);
    }
}

@@ -98,16 +98,76 @@
 owired;%0A
+import org.springframework.web.bind.annotation.RequestBody;%0A
 import o
@@ -827,11 +827,228 @@
 );%0A    %7D
+%0A%0A    @RequestMapping(method = RequestMethod.POST)%0A    public void applyMetadata(@PathWithinPattern String path, @RequestBody Metadata metadata) %7B%0A        metadataService.applyMetadataToUserPath(path, metadata);%0A    %7D
 %0A%7D%0A

Add POST support for /metadata/**