org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput Java Examples
The following examples show how to use
org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientAttributeCertificateResource.java From keycloak with Apache License 2.0 | 6 votes |
/** * Upload only certificate, not private key * * @param input * @return information extracted from uploaded certificate - not necessarily the new state of certificate on the server * @throws IOException */ @POST @Path("upload-certificate") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public CertificateRepresentation uploadJksCertificate(MultipartFormDataInput input) throws IOException { auth.clients().requireConfigure(client); try { CertificateRepresentation info = getCertFromRequest(input); info.setPrivateKey(null); CertificateInfoHelper.updateClientModelCertificateInfo(client, info, attributePrefix); adminEvent.operation(OperationType.ACTION).resourcePath(session.getContext().getUri()).representation(info).success(); return info; } catch (IllegalStateException ise) { throw new ErrorResponseException("certificate-not-found", "Certificate or key with given alias not found in the keystore", Response.Status.BAD_REQUEST); } }
Example #2
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 6 votes |
@Test public void testSecurityAnalysisJson() { MultipartFormDataInput dataInput = mock(MultipartFormDataInput.class); Map<String, List<InputPart>> formValues = new HashMap<>(); formValues.put("format", Collections.singletonList(new InputPartImpl("JSON", MediaType.TEXT_PLAIN_TYPE))); formValues.put("limit-types", Collections.singletonList(new InputPartImpl("CURRENT", MediaType.TEXT_PLAIN_TYPE))); MultivaluedMap<String, String> headers = new MultivaluedMapImpl<>(); headers.putSingle("Content-Disposition", "filename=" + "case-file.xiidm"); formValues.put("case-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("Network".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers))); MultivaluedMap<String, String> headers2 = new MultivaluedMapImpl<>(); headers2.putSingle("Content-Disposition", "filename=" + "contingencies-file.csv"); formValues.put("contingencies-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("contingencies".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers2))); when(dataInput.getFormDataMap()).thenReturn(formValues); Response res = service.analyze(dataInput); Assert.assertEquals(200, res.getStatus()); }
Example #3
Source File: ExtensionHandler.java From syndesis with Apache License 2.0 | 6 votes |
@Nonnull @SuppressWarnings("PMD.CyclomaticComplexity") private static InputStream getBinaryArtifact(MultipartFormDataInput input) { if (input == null || input.getParts() == null || input.getParts().isEmpty()) { throw new IllegalArgumentException("Multipart request is empty"); } try { InputStream result; if (input.getParts().size() == 1) { InputPart filePart = input.getParts().iterator().next(); result = filePart.getBody(InputStream.class, null); } else { result = input.getFormDataPart("file", InputStream.class, null); } if (result == null) { throw new IllegalArgumentException("Can't find a valid 'file' part in the multipart request"); } return result; } catch (IOException e) { throw new IllegalArgumentException("Error while reading multipart request", e); } }
Example #4
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 6 votes |
@Test public void testSecurityAnalysisCsv() { MultipartFormDataInput dataInput = mock(MultipartFormDataInput.class); Map<String, List<InputPart>> formValues = new HashMap<>(); formValues.put("format", Collections.singletonList(new InputPartImpl("CSV", MediaType.TEXT_PLAIN_TYPE))); formValues.put("limit-types", Collections.singletonList(new InputPartImpl("CURRENT", MediaType.TEXT_PLAIN_TYPE))); MultivaluedMap<String, String> headers = new MultivaluedMapImpl<>(); headers.putSingle("Content-Disposition", "filename=" + "case-file.xiidm"); formValues.put("case-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("Network".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers))); MultivaluedMap<String, String> headers2 = new MultivaluedMapImpl<>(); headers2.putSingle("Content-Disposition", "filename=" + "contingencies-file.csv"); formValues.put("contingencies-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("contingencies".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers2))); when(dataInput.getFormDataMap()).thenReturn(formValues); Response res = service.analyze(dataInput); Assert.assertEquals(200, res.getStatus()); }
Example #5
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 6 votes |
@Test public void testWrongFormat() { MultipartFormDataInput dataInput = mock(MultipartFormDataInput.class); Map<String, List<InputPart>> formValues = new HashMap<>(); formValues.put("format", Collections.singletonList(new InputPartImpl("ERR", MediaType.TEXT_PLAIN_TYPE))); formValues.put("limit-types", Collections.singletonList(new InputPartImpl("CURRENT", MediaType.TEXT_PLAIN_TYPE))); MultivaluedMap<String, String> headers = new MultivaluedMapImpl<>(); headers.putSingle("Content-Disposition", "filename=" + "case-file.xiidm.gz"); formValues.put("case-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("Network".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers))); MultivaluedMap<String, String> headers2 = new MultivaluedMapImpl<>(); headers2.putSingle("Content-Disposition", "filename=" + "contingencies-file.csv"); formValues.put("contingencies-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("contingencies".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers2))); when(dataInput.getFormDataMap()).thenReturn(formValues); Response res = service.analyze(dataInput); Assert.assertEquals(400, res.getStatus()); }
Example #6
Source File: DriverUploadEndpoint.java From syndesis with Apache License 2.0 | 6 votes |
private static InputStream getBinaryArtifact(MultipartFormDataInput input) { if (input == null || input.getParts() == null || input.getParts().isEmpty()) { throw new IllegalArgumentException("Multipart request is empty"); } try { final InputStream result = input.getFormDataPart("file", InputStream.class, null); if (result == null) { throw new IllegalArgumentException("Can't find a valid 'file' part in the multipart request"); } return result; } catch (IOException e) { throw new IllegalArgumentException("Error while reading multipart request", e); } }
Example #7
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 6 votes |
@Test public void testMissingFormat() { MultipartFormDataInput dataInput = mock(MultipartFormDataInput.class); Map<String, List<InputPart>> formValues = new HashMap<>(); formValues.put("limit-types", Collections.singletonList(new InputPartImpl("HIGH_VOLTAGE,CURRENT", MediaType.TEXT_PLAIN_TYPE))); MultivaluedMap<String, String> headers = new MultivaluedMapImpl<>(); headers.putSingle("Content-Disposition", "filename=" + "case-file.xiidm.gz"); formValues.put("case-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("Network".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers))); MultivaluedMap<String, String> headers2 = new MultivaluedMapImpl<>(); headers2.putSingle("Content-Disposition", "filename=" + "contingencies-file.csv"); formValues.put("contingencies-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("contingencies".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers2))); when(dataInput.getFormDataMap()).thenReturn(formValues); Response res = service.analyze(dataInput); Assert.assertEquals(400, res.getStatus()); }
Example #8
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 6 votes |
@Test public void testMissingCaseFile() { MultipartFormDataInput dataInput = mock(MultipartFormDataInput.class); Map<String, List<InputPart>> formValues = new HashMap<>(); formValues.put("format", Collections.singletonList(new InputPartImpl("JSON", MediaType.TEXT_PLAIN_TYPE))); formValues.put("limit-types", Collections.singletonList(new InputPartImpl("CURRENT", MediaType.TEXT_PLAIN_TYPE))); MultivaluedMap<String, String> headers2 = new MultivaluedMapImpl<>(); headers2.putSingle("Content-Disposition", "filename=" + "contingencies-file.csv"); formValues.put("contingencies-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("contingencies".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers2))); when(dataInput.getFormDataMap()).thenReturn(formValues); Response res = service.analyze(dataInput); Assert.assertEquals(400, res.getStatus()); }
Example #9
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 6 votes |
@Test public void testWrongLimits() { MultipartFormDataInput dataInput = mock(MultipartFormDataInput.class); Map<String, List<InputPart>> formValues = new HashMap<>(); formValues.put("format", Collections.singletonList(new InputPartImpl("JSON", MediaType.TEXT_PLAIN_TYPE))); formValues.put("limit-types", Collections.singletonList(new InputPartImpl("ERRR", MediaType.TEXT_PLAIN_TYPE))); MultivaluedMap<String, String> headers = new MultivaluedMapImpl<>(); headers.putSingle("Content-Disposition", "filename=" + "case-file.xiidm.gz"); formValues.put("case-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("Network".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers))); MultivaluedMap<String, String> headers2 = new MultivaluedMapImpl<>(); headers2.putSingle("Content-Disposition", "filename=" + "contingencies-file.csv"); formValues.put("contingencies-file", Collections.singletonList(new InputPartImpl(new ByteArrayInputStream("contingencies".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE, headers2))); when(dataInput.getFormDataMap()).thenReturn(formValues); Response res = service.analyze(dataInput); Assert.assertEquals(400, res.getStatus()); }
Example #10
Source File: FileUploadResource.java From blog-tutorials with MIT License | 6 votes |
@POST @Consumes(MediaType.MULTIPART_FORM_DATA) public void uploadFile(MultipartFormDataInput incomingFile) throws IOException { InputPart inputPart = incomingFile.getFormDataMap().get("file").get(0); InputStream uploadedInputStream = inputPart.getBody(InputStream.class, null); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len; while ((len = uploadedInputStream.read(buffer)) != -1) { byteArrayOutputStream.write(buffer, 0, len); } FileUpload upload = new FileUpload( getFileNameOfUploadedFile(inputPart.getHeaders().getFirst("Content-Disposition")), getContentTypeOfUploadedFile(inputPart.getHeaders().getFirst("Content-Type")), byteArrayOutputStream.toByteArray()); em.persist(upload); }
Example #11
Source File: PetApi.java From openapi-generator with Apache License 2.0 | 6 votes |
@POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext) throws NotFoundException { return service.uploadFile(input,petId,securityContext); }
Example #12
Source File: IdentityProvidersResource.java From keycloak with Apache License 2.0 | 6 votes |
/** * Import identity provider from uploaded JSON file * * @param input * @return * @throws IOException */ @POST @Path("import-config") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public Map<String, String> importFrom(MultipartFormDataInput input) throws IOException { this.auth.realm().requireManageIdentityProviders(); Map<String, List<InputPart>> formDataMap = input.getFormDataMap(); if (!(formDataMap.containsKey("providerId") && formDataMap.containsKey("file"))) { throw new BadRequestException(); } String providerId = formDataMap.get("providerId").get(0).getBodyAsString(); InputPart file = formDataMap.get("file").get(0); InputStream inputStream = file.getBody(InputStream.class, null); IdentityProviderFactory providerFactory = getProviderFactorytById(providerId); Map<String, String> config = providerFactory.parseConfig(session, inputStream); return config; }
Example #13
Source File: ClientAttributeCertificateResource.java From keycloak with Apache License 2.0 | 6 votes |
/** * Upload certificate and eventually private key * * @param input * @return * @throws IOException */ @POST @Path("upload") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public CertificateRepresentation uploadJks(MultipartFormDataInput input) throws IOException { auth.clients().requireConfigure(client); try { CertificateRepresentation info = getCertFromRequest(input); CertificateInfoHelper.updateClientModelCertificateInfo(client, info, attributePrefix); adminEvent.operation(OperationType.ACTION).resourcePath(session.getContext().getUri()).representation(info).success(); return info; } catch (IllegalStateException ise) { throw new ErrorResponseException("certificate-not-found", "Certificate or key with given alias not found in the keystore", Response.Status.BAD_REQUEST); } }
Example #14
Source File: PetApi.java From openapi-generator with Apache License 2.0 | 6 votes |
@POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext) throws NotFoundException { return service.uploadFile(input,petId,securityContext); }
Example #15
Source File: PetApi.java From openapi-generator with Apache License 2.0 | 5 votes |
@POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext);
Example #16
Source File: LibsApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/granite/security/post/truststore") @Consumes({ "multipart/form-data" }) @Produces({ "text/plain" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postTruststore(MultipartFormDataInput input, @QueryParam(":operation") String colonOperation, @QueryParam("newPassword") String newPassword, @QueryParam("rePassword") String rePassword, @QueryParam("keyStoreType") String keyStoreType, @QueryParam("removeAlias") String removeAlias,@Context SecurityContext securityContext);
Example #17
Source File: DriverUploadEndpoint.java From syndesis with Apache License 2.0 | 5 votes |
private static void storeFile(String location, MultipartFormDataInput dataInput) { // Store the artifact into /deployments/ext try (InputStream is = getBinaryArtifact(dataInput)) { final File file = new File(location); Files.copy(is, file.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw SyndesisServerException.launderThrowable("Unable to store the driver file into " + EXT_DIR, ex); } }
Example #18
Source File: DriverUploadEndpoint.java From syndesis with Apache License 2.0 | 5 votes |
@POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) public Boolean upload(MultipartFormDataInput input) { String fileName = getFileName(input); storeFile(String.format("%s/%s.jar", EXT_DIR, fileName), input); LOGGER.info("Driver {} succefully uploaded", fileName); return Boolean.TRUE; }
Example #19
Source File: DriverUploadEndpoint.java From syndesis with Apache License 2.0 | 5 votes |
private static String getFileName(MultipartFormDataInput input) { if (input == null || input.getParts() == null || input.getParts().isEmpty()) { throw new IllegalArgumentException("Multipart request is empty"); } try { final String fileName = input.getFormDataPart("fileName", String.class, null); if (fileName == null) { throw new IllegalArgumentException("Can't find a valid 'fileName' part in the multipart request"); } return fileName; } catch (IOException ex) { throw SyndesisServerException.launderThrowable("Unable to obtain fileName", ex); } }
Example #20
Source File: StudioInterface.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
/** * Validates a job. * @param multipart a HTTP multipart form which contains the job-descriptor * @return the result of job validation */ @POST @Path("{path:validate}") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces("application/json") JobValidationData validate(@HeaderParam("sessionid") String sessionId, @PathParam("path") PathSegment pathSegment, MultipartFormDataInput multipart) throws NotConnectedRestException;
Example #21
Source File: EtcApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/truststore") @Consumes({ "multipart/form-data" }) @Produces({ "text/plain" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postTruststorePKCS12(MultipartFormDataInput input,@Context SecurityContext securityContext);
Example #22
Source File: IntermediatePathApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/{authorizableId}.ks.html") @Consumes({ "multipart/form-data" }) @Produces({ "text/plain" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = KeystoreInfo.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Retrieved Authorizable Keystore info", response = KeystoreInfo.class), @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postAuthorizableKeystore(MultipartFormDataInput input, @PathParam("intermediatePath") String intermediatePath, @PathParam("authorizableId") String authorizableId, @QueryParam(":operation") String colonOperation, @QueryParam("currentPassword") String currentPassword, @QueryParam("newPassword") String newPassword, @QueryParam("rePassword") String rePassword, @QueryParam("keyPassword") String keyPassword, @QueryParam("keyStorePass") String keyStorePass, @QueryParam("alias") String alias, @QueryParam("newAlias") String newAlias, @QueryParam("removeAlias") String removeAlias,@Context SecurityContext securityContext);
Example #23
Source File: SecurityWsTest.java From ipst with Mozilla Public License 2.0 | 5 votes |
@Before public void setUp() { SecurityAnalysisResult result = new SecurityAnalysisResult( new LimitViolationsResult(true, Collections.emptyList()), Collections.emptyList()); service = Mockito.mock(SecurityAnalysisServiceImpl.class); when(service.analyze(any(Network.class), any(FilePart.class), any(LimitViolationFilter.class))) .thenReturn(result); when(service.analyze(any(MultipartFormDataInput.class))).thenCallRealMethod(); }
Example #24
Source File: EtcApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/truststore") @Consumes({ "multipart/form-data" }) @Produces({ "text/plain" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postTruststorePKCS12(MultipartFormDataInput input,@Context SecurityContext securityContext) throws NotFoundException { return service.postTruststorePKCS12(input,securityContext); }
Example #25
Source File: IntermediatePathApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/{authorizableId}.ks.html") @Consumes({ "multipart/form-data" }) @Produces({ "text/plain" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = KeystoreInfo.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Retrieved Authorizable Keystore info", response = KeystoreInfo.class), @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postAuthorizableKeystore(MultipartFormDataInput input, @PathParam("intermediatePath") String intermediatePath, @PathParam("authorizableId") String authorizableId, @QueryParam(":operation") String colonOperation, @QueryParam("currentPassword") String currentPassword, @QueryParam("newPassword") String newPassword, @QueryParam("rePassword") String rePassword, @QueryParam("keyPassword") String keyPassword, @QueryParam("keyStorePass") String keyStorePass, @QueryParam("alias") String alias, @QueryParam("newAlias") String newAlias, @QueryParam("removeAlias") String removeAlias,@Context SecurityContext securityContext) throws NotFoundException { return service.postAuthorizableKeystore(input,intermediatePath,authorizableId,colonOperation,currentPassword,newPassword,rePassword,keyPassword,keyStorePass,alias,newAlias,removeAlias,securityContext); }
Example #26
Source File: CrxApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/packmgr/service/.json/{path}") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "crx", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postPackageServiceJson(MultipartFormDataInput input, @PathParam("path") String path, @NotNull @QueryParam("cmd") String cmd, @QueryParam("groupName") String groupName, @QueryParam("packageName") String packageName, @QueryParam("packageVersion") String packageVersion, @QueryParam("_charset_") String charset, @QueryParam("force") Boolean force, @QueryParam("recursive") Boolean recursive,@Context SecurityContext securityContext) throws NotFoundException { return service.postPackageServiceJson(input,path,cmd,groupName,packageName,packageVersion,charset,force,recursive,securityContext); }
Example #27
Source File: PathApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/{name}") @Consumes({ "multipart/form-data" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = Void.class) }) public Response postNode(MultipartFormDataInput input, @PathParam("path") String path, @PathParam("name") String name, @QueryParam(":operation") String colonOperation, @QueryParam("deleteAuthorizable") String deleteAuthorizable,@Context SecurityContext securityContext) throws NotFoundException { return service.postNode(input,path,name,colonOperation,deleteAuthorizable,securityContext); }
Example #28
Source File: LibsApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/granite/security/post/truststore") @Consumes({ "multipart/form-data" }) @Produces({ "text/plain" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postTruststore(MultipartFormDataInput input, @QueryParam(":operation") String colonOperation, @QueryParam("newPassword") String newPassword, @QueryParam("rePassword") String rePassword, @QueryParam("keyStoreType") String keyStoreType, @QueryParam("removeAlias") String removeAlias,@Context SecurityContext securityContext) throws NotFoundException { return service.postTruststore(input,colonOperation,newPassword,rePassword,keyStoreType,removeAlias,securityContext); }
Example #29
Source File: CrxApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/packmgr/service/.json/{path}") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "crx", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = String.class) }) public Response postPackageServiceJson(MultipartFormDataInput input, @PathParam("path") String path, @NotNull @QueryParam("cmd") String cmd, @QueryParam("groupName") String groupName, @QueryParam("packageName") String packageName, @QueryParam("packageVersion") String packageVersion, @QueryParam("_charset_") String charset, @QueryParam("force") Boolean force, @QueryParam("recursive") Boolean recursive,@Context SecurityContext securityContext);
Example #30
Source File: PathApi.java From swagger-aem with Apache License 2.0 | 5 votes |
@POST @Path("/{name}") @Consumes({ "multipart/form-data" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "aemAuth") }, tags={ "sling", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Default response", response = Void.class) }) public Response postNode(MultipartFormDataInput input, @PathParam("path") String path, @PathParam("name") String name, @QueryParam(":operation") String colonOperation, @QueryParam("deleteAuthorizable") String deleteAuthorizable,@Context SecurityContext securityContext);