|
|
|
@ -40,7 +40,7 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
|
|
|
|
|
TokenSetter.set(scope);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Used for local test data
|
|
|
|
|
private static Concessione upload(StorageUtils storage, WebTarget target,String id, String path, String ...files) throws Exception {
|
|
|
|
|
FileSets.RequestBuilder builder = FileSets.build(path);
|
|
|
|
|
|
|
|
|
@ -52,6 +52,17 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
|
|
|
|
|
MediaType.APPLICATION_JSON)),Concessione.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//generic
|
|
|
|
|
private static Concessione upload(StorageUtils storage, WebTarget target,String id, String path, File ...files) throws Exception {
|
|
|
|
|
FileSets.RequestBuilder builder = FileSets.build(path);
|
|
|
|
|
|
|
|
|
|
for(File file:files)
|
|
|
|
|
builder.add(storage.putOntoStorage(file,file.getName()));
|
|
|
|
|
|
|
|
|
|
return check(target.path(FILES_PATH).path(id).request(MediaType.APPLICATION_JSON).
|
|
|
|
|
post(Entity.entity(Serialization.write(builder.getTheRequest()),
|
|
|
|
|
MediaType.APPLICATION_JSON)),Concessione.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Concessione publish(WebTarget target, Concessione conc) throws Exception {
|
|
|
|
|
Response resp=target.path(PUBLISH_PATH).path(conc.getMongo_id()).request(MediaType.APPLICATION_JSON).
|
|
|
|
@ -298,12 +309,15 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
|
|
|
|
|
upload(storage,target,c.getMongo_id(),Paths.ABSTRACT_RELAZIONE,"relazione.pdf");
|
|
|
|
|
|
|
|
|
|
upload(storage,target,c.getMongo_id(),Paths.POSIZIONAMENTO,
|
|
|
|
|
TestModel.getBaseFolder().list((file,name)->{return name.startsWith("pos");}));
|
|
|
|
|
|
|
|
|
|
// TestModel.getBaseFolder().list((file,name)->{return name.startsWith("pos");}));
|
|
|
|
|
new File("/Users/fabioisti/Documents/invio_08_05/Montalto di Castro (VT)_Vulci_Indagini non invasive_Doc. paragr._Va/CONSEGNA_WGS84")
|
|
|
|
|
.listFiles((file,name)->{return name.startsWith("Mag_area");}));
|
|
|
|
|
// Clash on workspaces
|
|
|
|
|
upload(storage,target,c.getMongo_id(),Paths.piantaByIndex(0),
|
|
|
|
|
TestModel.getBaseFolder().list((file,name)->{return name.startsWith("pianta");}));
|
|
|
|
|
// TestModel.getBaseFolder().list((file,name)->{return name.startsWith("pianta");}));
|
|
|
|
|
|
|
|
|
|
new File("/Users/fabioisti/Documents/invio_08_05/Montalto di Castro (VT)_Vulci_Indagini non invasive_Doc. paragr._Va/CONSEGNA_WGS84")
|
|
|
|
|
.listFiles((file,name)->{return name.startsWith("Mag_anomalies_WGS84");}));
|
|
|
|
|
upload(storage,target,c.getMongo_id(),Paths.imgByIndex(0),"immagine.png");
|
|
|
|
|
upload(storage,target,c.getMongo_id(),Paths.imgByIndex(1),"immagine2.png");
|
|
|
|
|
|
|
|
|
|