Class FileWebService
java.lang.Object
org.apache.openmeetings.webservice.BaseWebService
org.apache.openmeetings.webservice.FileWebService
@Service("fileWebService")
@Produces("application/json")
@Path("/file")
public class FileWebService
extends BaseWebService
Contains methods to import and upload files into the Files section of the
conference room and the personal drive of any USER
- Author:
- sebawagner
-
Field Summary
Fields inherited from class org.apache.openmeetings.webservice.BaseWebService
fileDao, roomDao, sessionDao, userDao
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(String sid, FileItemDTO file, InputStream stream) to add a folder to the private drive, set parentId = 0 and isOwner to 1/true and externalUserId/externalUserType to a valid USERdeletes files or folders based on it iddeleteExternal
(String sid, String externalType, String externalId) deletes a file by its external Id and typegetAllExternal
(String sid, String externalType) Get all files by external typeGet a File Explorer Object by a given ROOMgetRoomByParent
(String sid, long roomId, long parentId) Get list ofFileItemDTO
by parentmove a file or folderupdate a file or folder name
-
Constructor Details
-
FileWebService
public FileWebService()
-
-
Method Details
-
delete
@DELETE @Path("/{id}") public ServiceResult delete(@QueryParam("sid") String sid, @PathParam("id") Long id) throws ServiceException deletes files or folders based on it id- Parameters:
sid
- The SID of the User. This SID must be marked as logged inid
- the id of the file or folder- Returns:
ServiceResult
with result type- Throws:
ServiceException
-
deleteExternal
@DELETE @Path("/{externaltype}/{externalid}") public ServiceResult deleteExternal(@QueryParam("sid") String sid, @PathParam("externaltype") String externalType, @PathParam("externalid") String externalId) throws ServiceException deletes a file by its external Id and type- Parameters:
sid
- The SID of the User. This SID must be marked as logged inexternalType
- the externalTypeexternalId
- the id of the file or folder- Returns:
ServiceResult
with result type- Throws:
ServiceException
-
add
@POST @Consumes("multipart/form-data") @Path("/") public FileItemDTO add(@QueryParam("sid") String sid, FileItemDTO file, InputStream stream) throws ServiceException to add a folder to the private drive, set parentId = 0 and isOwner to 1/true and externalUserId/externalUserType to a valid USER- Parameters:
sid
- The SID of the User. This SID must be marked as logged infile
- the The file attributes to be addedstream
- the The file to be added- Returns:
- - Object created
- Throws:
ServiceException
-
getAllExternal
@GET @Path("/{externaltype}") public List<FileItemDTO> getAllExternal(@QueryParam("sid") String sid, @PathParam("externaltype") String externalType) throws ServiceException Get all files by external type- Parameters:
sid
- The SID of the User. This SID must be marked as logged inexternalType
- External type for file listing- Returns:
- - the list of files for given external type
- Throws:
ServiceException
-
getRoom
@GET @Path("/room/{id}") public FileExplorerObject getRoom(@QueryParam("sid") String sid, @PathParam("id") long roomId) throws ServiceException Get a File Explorer Object by a given ROOM- Parameters:
sid
- The SID of the User. This SID must be marked as logged inroomId
- ROOM Id- Returns:
- - File Explorer Object by a given ROOM
- Throws:
ServiceException
-
getRoomByParent
@GET @Path("/room/{id}/{parent}") public List<FileItemDTO> getRoomByParent(@QueryParam("sid") String sid, @PathParam("id") long roomId, @PathParam("parent") long parentId) throws ServiceException Get list ofFileItemDTO
by parent- Parameters:
sid
- SID The SID of the User. This SID must be marked as logged inparentId
- the parent folder idroomId
- the room id- Returns:
- - list of file explorer items
- Throws:
ServiceException
-
rename
@POST @Path("/rename/{id}/{name}") public FileItemDTO rename(@QueryParam("sid") String sid, @PathParam("id") long id, @PathParam("name") String name) throws ServiceException update a file or folder name- Parameters:
sid
- SID The SID of the User. This SID must be marked as logged inid
- file or folder idname
- new file or folder name- Returns:
- - resulting file object
- Throws:
ServiceException
-
move
@POST @Path("/move/{roomid}/{id}/{parentid}") public FileItemDTO move(@QueryParam("sid") String sid, @PathParam("id") long id, @PathParam("roomid") long roomId, @PathParam("parentid") long parentId) throws ServiceException move a file or folder- Parameters:
sid
- SID The SID of the User. This SID must be marked as logged inid
- current file or folder id to be movedroomId
- room this file need to be movedparentId
- new parent folder id- Returns:
- - resulting file object
- Throws:
ServiceException
-