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 Detail

      • FileWebService

        public FileWebService()
    • Method Detail

      • 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 in
        id - 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 in
        externalType - the externalType
        externalId - 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 in
        file - the The file attributes to be added
        stream - 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 in
        externalType - 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 in
        roomId - 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 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
        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 in
        id - file or folder id
        name - 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 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
        Throws:
        ServiceException