}
@Override
- public void createFolder(Long userId, Long parentId, String name)
+ public FolderDTO createFolder(Long userId, Long parentId, String name)
throws DuplicateNameException, ObjectNotFoundException, InsufficientPermissionsException {
// Validate.
if (userId == null)
" to write to this folder");
// Do the actual work.
- createFolder(name, parent, creator);
+ return createFolder(name, parent, creator);
}
/**
* @param name
* @param parent
* @param creator
+ * @return the new folder
*/
- private void createFolder(String name, Folder parent, User creator) {
+ private FolderDTO createFolder(String name, Folder parent, User creator) {
Folder folder = new Folder();
folder.setName(name);
if (parent != null) {
folder.addPermission(permission);
}
dao.create(folder);
+ return folder.getDTO();
}
/*
}
@Override
- public void modifyFolder(Long userId, Long folderId, String folderName)
+ public FolderDTO modifyFolder(Long userId, Long folderId, String folderName)
throws InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException {
// Validate.
// Do the actual modification.
folder.setName(folderName);
dao.update(folder);
+ return folder.getDTO();
}
/*
}
@Override
- public void moveFileToPath(Long userId, Long ownerId, Long fileId, String dest) throws ObjectNotFoundException, InsufficientPermissionsException, DuplicateNameException, GSSIOException, QuotaExceededException {
+ public void moveFileToPath(Long userId, Long ownerId, Long fileId, String dest) throws ObjectNotFoundException, InsufficientPermissionsException, QuotaExceededException {
if (userId == null)
throw new ObjectNotFoundException("No user specified");
if (ownerId == null)
* @see gr.ebs.gss.server.ejb.ExternalAPI#moveFiles(java.lang.Long, java.util.List, java.lang.Long)
*/
@Override
- public void moveFiles(Long userId, List<Long> fileIds, Long destId) throws InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException, GSSIOException, QuotaExceededException {
+ public void moveFiles(Long userId, List<Long> fileIds, Long destId) throws InsufficientPermissionsException, ObjectNotFoundException, QuotaExceededException {
for(Long l : fileIds){
FileHeader file = dao.getEntityById(FileHeader.class, l);
moveFile(userId, l, destId, file.getName());
return "application/vnd.ms-powerpoint";
else if (".pdf".equals(extension))
return "application/pdf";
+ else if (".gif".equals(extension))
+ return "image/gif";
+ else if (".jpg".equals(extension) || ".jpeg".equals(extension) || ".jpe".equals(extension))
+ return "image/jpeg";
+ else if (".tiff".equals(extension) || ".tif".equals(extension))
+ return "image/tiff";
+ else if (".png".equals(extension))
+ return "image/png";
+ else if (".bmp".equals(extension))
+ return "image/bmp";
}
// when all else fails assign the default mime type
return DEFAULT_MIME_TYPE;