class SoapFolderService extends AbstractService implements FolderService {

	@Override
	public WSFolder[] listWorkspaces(String sid) throws Exception {
		User user = validateSession(sid);

		FolderDAO folderDao = (FolderDAO) Context.get().getBean(FolderDAO.class);
		List<Folder> folders = folderDao.findByUserId(user.getId(), folderDao.findRoot(user.getTenantId()).getId());
		List<WSFolder> wsFolders = new ArrayList<WSFolder>();
		for (Folder folder : folders) {
			if (folder.getType() == Folder.TYPE_WORKSPACE) {
				folderDao.initialize(folder);
				wsFolders.add(WSFolder.fromFolder(folder));
			}
		}
		return wsFolders.toArray(new WSFolder[0]);
	}

}