Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      FileWebService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.openmeetings.db.dto.file.FileItemDTO add​(java.lang.String sid, org.apache.openmeetings.db.dto.file.FileItemDTO file, java.io.InputStream stream)
      to add a folder to the private drive, set parentId = 0 and isOwner to 1/true and externalUserId/externalUserType to a valid user
      org.apache.openmeetings.db.dto.basic.ServiceResult delete​(java.lang.String sid, java.lang.Long id)
      deletes files or folders based on it id
      org.apache.openmeetings.db.dto.basic.ServiceResult deleteExternal​(java.lang.String sid, java.lang.String externalType, java.lang.String externalId)
      deletes a file by its external Id and type
      java.util.List<org.apache.openmeetings.db.dto.file.FileItemDTO> getAllExternal​(java.lang.String sid, java.lang.String externalType)
      Get all files by external type
      org.apache.openmeetings.db.dto.file.FileExplorerObject getRoom​(java.lang.String sid, long roomId)
      Get a File Explorer Object by a given Room
      java.util.List<org.apache.openmeetings.db.dto.file.FileItemDTO> getRoomByParent​(java.lang.String sid, long roomId, long parentId)
      Get list of FileItemDTO by parent
      org.apache.openmeetings.db.dto.file.FileItemDTO move​(java.lang.String sid, long id, long roomId, long parentId)
      move a file or folder
      org.apache.openmeetings.db.dto.file.FileItemDTO rename​(java.lang.String sid, long id, java.lang.String name)
      update a file or folder name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileWebService

        public FileWebService()
    • Method Detail

      • delete

        @DELETE
        @Path("/{id}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult delete​(@QueryParam("sid")
                                                                         java.lang.String sid,
                                                                         @PathParam("id")
                                                                         java.lang.Long id)
        deletes files or folders based on it id
        Parameters:
        sid - The SID of the User. This SID must be marked as logged in
        id - the id of the file or folder
        Returns:
        ServiceResult with result type
      • deleteExternal

        @DELETE
        @Path("/{externaltype}/{externalid}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult deleteExternal​(@QueryParam("sid")
                                                                                 java.lang.String sid,
                                                                                 @PathParam("externaltype")
                                                                                 java.lang.String externalType,
                                                                                 @PathParam("externalid")
                                                                                 java.lang.String externalId)
        deletes a file by its external Id and type
        Parameters:
        sid - The SID of the User. This SID must be marked as logged in
        externalId - the od of the file or folder
        externalType - the externalType
        Returns:
        ServiceResult with result type
      • add

        @POST
        @Consumes("multipart/form-data")
        @Path("/")
        public org.apache.openmeetings.db.dto.file.FileItemDTO add​(@QueryParam("sid")
                                                                   java.lang.String sid,
                                                                   org.apache.openmeetings.db.dto.file.FileItemDTO file,
                                                                   java.io.InputStream stream)
        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 in
        file - the The file to be added
        stream - the The file to be added
        Returns:
        - Object created
      • getAllExternal

        @GET
        @Path("/{externaltype}")
        public java.util.List<org.apache.openmeetings.db.dto.file.FileItemDTO> getAllExternal​(@QueryParam("sid")
                                                                                              java.lang.String sid,
                                                                                              @PathParam("externaltype")
                                                                                              java.lang.String externalType)
        Get all files by external type
        Parameters:
        sid - The SID of the User. This SID must be marked as logged in
        externalType - External type for file listing
        Returns:
        - the list of file for given external type
      • getRoom

        @GET
        @Path("/room/{id}")
        public org.apache.openmeetings.db.dto.file.FileExplorerObject getRoom​(@QueryParam("sid")
                                                                              java.lang.String sid,
                                                                              @PathParam("id")
                                                                              long roomId)
        Get a File Explorer Object by a given Room
        Parameters:
        sid - The SID of the User. This SID must be marked as logged in
        roomId - Room Id
        Returns:
        - File Explorer Object by a given Room
      • getRoomByParent

        @GET
        @Path("/room/{id}/{parent}")
        public java.util.List<org.apache.openmeetings.db.dto.file.FileItemDTO> getRoomByParent​(@QueryParam("sid")
                                                                                               java.lang.String sid,
                                                                                               @PathParam("id")
                                                                                               long roomId,
                                                                                               @PathParam("parent")
                                                                                               long parentId)
        Get list of FileItemDTO by parent
        Parameters:
        sid - SID The SID of the User. This SID must be marked as logged in
        parentId - the parent folder id
        roomId - the room id
        Returns:
        - list of file explorer items
      • rename

        @POST
        @Path("/rename/{id}/{name}")
        public org.apache.openmeetings.db.dto.file.FileItemDTO rename​(@QueryParam("sid")
                                                                      java.lang.String sid,
                                                                      @PathParam("id")
                                                                      long id,
                                                                      @PathParam("name")
                                                                      java.lang.String name)
        update a file or folder name
        Parameters:
        sid - SID The SID of the User. This SID must be marked as logged in
        id - file or folder id
        name - new file or folder name
        Returns:
        - resulting file object
      • move

        @POST
        @Path("/move/{roomid}/{id}/{parentid}")
        public org.apache.openmeetings.db.dto.file.FileItemDTO move​(@QueryParam("sid")
                                                                    java.lang.String sid,
                                                                    @PathParam("id")
                                                                    long id,
                                                                    @PathParam("roomid")
                                                                    long roomId,
                                                                    @PathParam("parentid")
                                                                    long parentId)
        move a file or folder
        Parameters:
        sid - SID The SID of the User. This SID must be marked as logged in
        id - current file or folder id to be moved
        roomId - room this file need to be moved
        parentId - new parent folder id
        Returns:
        - resulting file object