/** Do a PUT or POST to a dataset, sending the contents of the file. * <p> * The Content-Type is inferred from the file extension. * <p> * "Replace" implies PUT, otherwise a POST is used. */ protected void doPutPostDataset(String file, boolean replace) { Lang lang = RDFLanguages.filenameToLang(file); File f = new File(file); long length = f.length(); exec(()->{ HttpEntity entity = fileToHttpEntity(file, lang); if ( replace ) HttpOp.execHttpPut(destination, entity, httpClient, httpContext); else HttpOp.execHttpPost(destination, entity, httpClient, httpContext); }); }
/** Do a PUT or POST to a dataset, sending the contents of the file. * <p> * The Content-Type is inferred from the file extension. * <p> * "Replace" implies PUT, otherwise a POST is used. */ protected void doPutPostDataset(String file, boolean replace) { Lang lang = RDFLanguages.filenameToLang(file); File f = new File(file); long length = f.length(); exec(()->{ HttpEntity entity = fileToHttpEntity(file, lang); if ( replace ) HttpOp.execHttpPut(destination, entity, httpClient, httpContext); else HttpOp.execHttpPost(destination, entity, httpClient, httpContext); }); }
HttpEntity entity = fileToHttpEntity(file, lang); if ( replace ) HttpOp.execHttpPut(url, entity, httpClient, httpContext);
HttpEntity entity = fileToHttpEntity(file, lang); if ( replace ) HttpOp.execHttpPut(url, entity, httpClient, httpContext);