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 BaseWebServiceContains 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
Constructors Constructor Description FileWebService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileItemDTOadd(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 USERServiceResultdelete(String sid, Long id)deletes files or folders based on it idServiceResultdeleteExternal(String sid, String externalType, String externalId)deletes a file by its external Id and typeList<FileItemDTO>getAllExternal(String sid, String externalType)Get all files by external typeFileExplorerObjectgetRoom(String sid, long roomId)Get a File Explorer Object by a given ROOMList<FileItemDTO>getRoomByParent(String sid, long roomId, long parentId)Get list ofFileItemDTOby parentFileItemDTOmove(String sid, long id, long roomId, long parentId)move a file or folderFileItemDTOrename(String sid, long id, String name)update a file or folder name
-
-
-
Method Detail
-
delete
@DELETE @Path("/{id}") public ServiceResult delete(@QueryParam("sid") String sid, @PathParam("id") Long id) throws ServiceExceptiondeletes 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:
ServiceResultwith 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 ServiceExceptiondeletes 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:
ServiceResultwith result type- Throws:
ServiceException
-
add
@POST @Consumes("multipart/form-data") @Path("/") public FileItemDTO add(@QueryParam("sid") String sid, FileItemDTO file, InputStream stream) throws ServiceExceptionto 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 ServiceExceptionGet 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 ServiceExceptionGet 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 ServiceExceptionGet list ofFileItemDTOby 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 ServiceExceptionupdate 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 ServiceExceptionmove 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
-
-