This project has retired. For details please refer to its
Attic page.
FileUploadService xref
1 package org.apache.archiva.web.api;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
22 import org.apache.archiva.security.common.ArchivaRoleConstants;
23 import org.apache.archiva.web.model.FileMetadata;
24 import org.apache.cxf.jaxrs.ext.multipart.MultipartBody;
25 import org.apache.archiva.redback.authorization.RedbackAuthorization;
26
27 import javax.ws.rs.Consumes;
28 import javax.ws.rs.DELETE;
29 import javax.ws.rs.GET;
30 import javax.ws.rs.POST;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.PathParam;
33 import javax.ws.rs.Produces;
34 import javax.ws.rs.QueryParam;
35 import javax.ws.rs.core.MediaType;
36 import java.util.List;
37
38
39
40
41
42 @Path( "/fileUploadService/" )
43 public interface FileUploadService
44 {
45
46 String FILES_SESSION_KEY = FileUploadService.class.getName() + "files_session_key";
47
48 @POST
49 @Consumes( MediaType.MULTIPART_FORM_DATA )
50 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
51 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD )
52 FileMetadata post( MultipartBody multipartBody )
53 throws ArchivaRestServiceException;
54
55 @Path( "{fileName}" )
56 @DELETE
57 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
58 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD )
59 Boolean deleteFile( @PathParam( "fileName" ) String fileName )
60 throws ArchivaRestServiceException;
61
62
63 @Path( "sessionFileMetadatas" )
64 @GET
65 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
66 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD )
67 List<FileMetadata> getSessionFileMetadatas()
68 throws ArchivaRestServiceException;
69
70 @Path( "save/{repositoryId}/{groupId}/{artifactId}/{version}/{packaging}" )
71 @GET
72 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
73 @RedbackAuthorization( resource = "{repositoryId}", permissions = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD )
74 Boolean save( @PathParam( "repositoryId" ) String repositoryId, @PathParam( "groupId" ) String groupId,
75 @PathParam( "artifactId" ) String artifactId, @PathParam( "version" ) String version,
76 @PathParam( "packaging" ) String packaging, @QueryParam( "generatePom" ) boolean generatePom )
77 throws ArchivaRestServiceException;
78
79
80 @Path( "clearUploadedFiles" )
81 @GET
82 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
83 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD )
84 Boolean clearUploadedFiles()
85 throws ArchivaRestServiceException;
86
87 }