@@ -0,0 +1,1331 @@
+package org.araymond.joal.web.resources;%0A%0Aimport com.google.common.base.Charsets;%0Aimport com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;%0Aimport com.sun.org.apache.xml.internal.security.utils.Base64;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestBody;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.ResponseStatus;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Created by raymo on 12/07/2017.%0A */%0A@Controller%0A@RequestMapping(%22/torrents%22)%0Apublic class HttpTorrentFileController %7B%0A    private static final Logger logger = LoggerFactory.getLogger(HttpTorrentFileController.class);%0A%0A    @ResponseStatus(HttpStatus.OK)%0A    @RequestMapping(value = %22/add%22, method = RequestMethod.POST)%0A    public void addTorrent(@RequestBody final String b64TorrentFile) throws IOException %7B%0A        try %7B%0A            byte%5B%5D bytes = Base64.decode(b64TorrentFile);%0A            logger.info(new String(bytes, Charsets.ISO_8859_1));%0A        %7D catch (final Base64DecodingException e) %7B%0A            logger.error(%22failed to add file%22, e);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add upload file controller (still need to dispatch create file on server)