Loading Java_MarkLogic_Template/MarkLogic_Template/src/main/java/edu/psu/MarkLogic/demo/controller/MLRestController.java +2 −2 Original line number Diff line number Diff line Loading @@ -88,14 +88,14 @@ public class MLRestController { @PostMapping(value = "/restCreateDoc") public @ResponseBody String restCreateDoc(@RequestParam("files") MultipartFile[] uploadfiles) { String restCreateDoc(@RequestParam("files") MultipartFile[] uploadfiles) { // WHY DOES THIS TAKE IN AN ARRAY?????? try { CredentialsProvider provider = new BasicCredentialsProvider(); Credentials credentials = new UsernamePasswordCredentials("admin", "admin"); // provide username & password provider.setCredentials(AuthScope.ANY, credentials); HttpClient httpClient = HttpClientBuilder.create().setDefaultCredentialsProvider(provider).build(); String uri = ""; // provide the REST API URI String uri = "http://192.168.56.200:8000/LATEST/documents?uri=/final-project/" /* + the name of the file we're trying to upload goes here */; // provide the REST API URI HttpPut put = new HttpPut(uri); Loading Loading
Java_MarkLogic_Template/MarkLogic_Template/src/main/java/edu/psu/MarkLogic/demo/controller/MLRestController.java +2 −2 Original line number Diff line number Diff line Loading @@ -88,14 +88,14 @@ public class MLRestController { @PostMapping(value = "/restCreateDoc") public @ResponseBody String restCreateDoc(@RequestParam("files") MultipartFile[] uploadfiles) { String restCreateDoc(@RequestParam("files") MultipartFile[] uploadfiles) { // WHY DOES THIS TAKE IN AN ARRAY?????? try { CredentialsProvider provider = new BasicCredentialsProvider(); Credentials credentials = new UsernamePasswordCredentials("admin", "admin"); // provide username & password provider.setCredentials(AuthScope.ANY, credentials); HttpClient httpClient = HttpClientBuilder.create().setDefaultCredentialsProvider(provider).build(); String uri = ""; // provide the REST API URI String uri = "http://192.168.56.200:8000/LATEST/documents?uri=/final-project/" /* + the name of the file we're trying to upload goes here */; // provide the REST API URI HttpPut put = new HttpPut(uri); Loading