Created
March 22, 2017 02:44
-
-
Save cjvirtucio87/62a01404fa01cac6c85df9f1679312b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
public class Uploads { | |
// ... | |
@RequestMapping(value="/uploads", method={ RequestMethod.HEAD }) | |
public ResponseEntity<?> headUploads( | |
@RequestHeader(value="Upload-Metadata") String meta, | |
@RequestHeader(value="Tus-Resumable") String ver | |
) { | |
// ... | |
} | |
@RequestMapping(value="/uploads", method={ RequestMethod.POST }) | |
public ResponseEntity<?> postUploads( | |
@RequestHeader(value="Content-Length") Long conLen, | |
@RequestHeader(value="Upload-Length") Long upLen, | |
@RequestHeader(value="Upload-Metadata") String meta, | |
@RequestHeader(value="Tus-Resumable") String ver | |
) { | |
// ... | |
} | |
@RequestMapping(value="/uploads/{id}", method={ RequestMethod.PATCH }) | |
public ResponseEntity<?> patchUpload( | |
@RequestHeader(value="Content-Length") Long conLen, | |
@RequestHeader(value="Upload-Length") Long upLen, | |
@RequestHeader(value="Upload-Offset") Long upOff, | |
@RequestHeader(value="Upload-Metadata") String meta, | |
@RequestHeader(value="Tus-Resumable") String ver, | |
HttpServletRequest req | |
) { | |
// You'll be streaming the data from the request into your file using one of Java's many I/O libraries. | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment