diff --git a/src/main/java/org/eclipse/basyx/extensions/aas/aggregator/aasxupload/AASAggregatorAASXUpload.java b/src/main/java/org/eclipse/basyx/extensions/aas/aggregator/aasxupload/AASAggregatorAASXUpload.java index b371b883..95ea0927 100644 --- a/src/main/java/org/eclipse/basyx/extensions/aas/aggregator/aasxupload/AASAggregatorAASXUpload.java +++ b/src/main/java/org/eclipse/basyx/extensions/aas/aggregator/aasxupload/AASAggregatorAASXUpload.java @@ -99,7 +99,7 @@ private void uploadNestedFiles(IIdentifier aasIdentification, AASXToMetamodelCon private void uploadFileInSubmodelElement(IIdentifier aasIdentification, AASXToMetamodelConverter converter, File submodelElement, String submodelElementPath) { try { - getAASProvider(aasIdentification).createValue(submodelElementPath + "/File/upload", converter.retrieveFileInputStream((String) submodelElement.getValue())); + getAASProvider(aasIdentification).createValue(submodelElementPath + "/upload", converter.retrieveFileInputStream((String) submodelElement.getValue())); } catch (InvalidFormatException | IOException e) { e.printStackTrace(); } diff --git a/src/main/java/org/eclipse/basyx/submodel/restapi/SubmodelProvider.java b/src/main/java/org/eclipse/basyx/submodel/restapi/SubmodelProvider.java index 4990fb13..8aa8dc3d 100644 --- a/src/main/java/org/eclipse/basyx/submodel/restapi/SubmodelProvider.java +++ b/src/main/java/org/eclipse/basyx/submodel/restapi/SubmodelProvider.java @@ -349,7 +349,7 @@ private boolean endsWithFileUpload(String[] splitted) { private String getFileIdShortFromSplittedPath4FileUpload(String[] splitted) { String idShort = ""; - for (int i = 1; i < splitted.length - 2; i++) { + for (int i = 1; i < splitted.length - 1; i++) { idShort = concatFileIdShortPath(splitted, idShort, i); } return idShort; diff --git a/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/restapi/TestHttpFileUpload.java b/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/restapi/TestHttpFileUpload.java index 6b2fd2d0..3c740fbe 100644 --- a/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/restapi/TestHttpFileUpload.java +++ b/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/restapi/TestHttpFileUpload.java @@ -129,7 +129,7 @@ private CloseableHttpResponse uploadDummyFileToSubmodelElement(String submodelEl HttpPost uploadFile = new HttpPost( API_URL + "/basyx.examples.test/aas/submodels/test_sm/submodel/submodelElements/" - + submodelElementIdShort + "/File/upload"); + + submodelElementIdShort + "/upload"); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.addPart("file", new FileBody(file));