public class OKMMail extends Object implements MailModule
| Modifier and Type | Method and Description |
|---|---|
void |
copy(String token,
String mailPath,
String dstId)
Copy a mail to another location in the repository.
|
Mail |
create(String token,
Mail mail)
Create a new mail in the repository.
|
void |
delete(String token,
String mailId)
Delete a mail the repository.
|
void |
extendedCopy(String token,
String mailPath,
String dstId,
ExtendedAttributes extAttr)
Copy a mail to another location in the repository.
|
List<Mail> |
getChildren(String token,
String fldId)
Retrieve a list of children mails from an existing folder.
|
List<Mail> |
getChilds(String token,
String fldId)
Deprecated.
|
static OKMMail |
getInstance() |
String |
getPath(String token,
String uuid)
Get the mail path from a UUID
|
Mail |
getProperties(String token,
String mailId)
Obtains properties from a previously created mail.
|
Mail |
importEml(String path,
InputStream is)
Import EML file as MailNode.
|
Mail |
importMsg(String path,
InputStream is)
Import MSG file as MailNode.
|
boolean |
isValid(String token,
String mailId)
Test if a mail path is valid.
|
void |
move(String token,
String mailPath,
String dstId)
Move a mail to another location in the repository.
|
void |
purge(String token,
String mailId)
Deletes definitively a mail from the repository.
|
Mail |
rename(String token,
String mailId,
String newName)
Rename a mail in the repository.
|
public static OKMMail getInstance()
public Mail create(String token, Mail mail) throws PathNotFoundException, ItemExistsException, VirusDetectedException, AccessDeniedException, RepositoryException, DatabaseException, UserQuotaExceededException, AutomationException
MailModulecreate in interface MailModulemail - A mail object with the new mail properties.PathNotFoundException - If the parent mail doesn't exist.ItemExistsException - If there is already a mail in the
repository with the same name in the same path.AccessDeniedException - If there is any security problem:
you can't modify the parent mail because of lack of permissions.RepositoryException - If there is any general repository problem.VirusDetectedExceptionDatabaseExceptionUserQuotaExceededExceptionAutomationExceptionpublic Mail getProperties(String token, String mailId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
MailModulegetProperties in interface MailModulemailId - The path that identifies an unique mail, or its UUID.PathNotFoundException - If the indicated mail doesn't exist.RepositoryException - If there is any general repository problem.AccessDeniedExceptionDatabaseExceptionpublic void delete(String token, String mailId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
MailModuledelete in interface MailModulemailId - The path that identifies an unique mail.LockException - Can't delete a mail with locked documents.PathNotFoundException - If there is no mail in the repository in this path.AccessDeniedException - If there is any security problem:
you can't modify the mail because of lack of permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void purge(String token, String mailId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
MailModulepurge in interface MailModulemailId - The path that identifies an unique mail.LockException - Can't delete a mail with locked documents.PathNotFoundException - If there is no mail in the repository in this path.AccessDeniedException - If there is any security problem:
you can't modify the mail because of lack of permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic Mail rename(String token, String mailId, String newName) throws PathNotFoundException, ItemExistsException, AccessDeniedException, RepositoryException, DatabaseException
MailModulerename in interface MailModulemailId - The path that identifies an unique mail.newName - The new mail name.PathNotFoundException - If there is no mail in the repository in this path.ItemExistsException - If there is already a mail in the
repository with the same name in the same path.AccessDeniedException - If there is any security problem:
you can't modify the mail because of lack of permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void move(String token, String mailPath, String dstId) throws PathNotFoundException, ItemExistsException, AccessDeniedException, RepositoryException, DatabaseException
MailModulemove in interface MailModulemailPath - The path that identifies an unique mail.dstId - The path of the destination mail.PathNotFoundException - If the dstPath does not exists.ItemExistsException - If there is already a mail in the
destination mail with the same name.AccessDeniedException - If there is any security problem:
you can't modify the parent mail or the destination mail
because of lack of permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void copy(String token, String mailPath, String dstId) throws PathNotFoundException, ItemExistsException, AccessDeniedException, RepositoryException, IOException, AutomationException, DatabaseException, UserQuotaExceededException
MailModulecopy in interface MailModulemailPath - The path that identifies an unique mail.dstId - The path of the destination mail.PathNotFoundException - If the dstPath does not exists.ItemExistsException - If there is already a mail in the
destination mail with the same name.AccessDeniedException - If there is any security problem:
you can't modify the parent mail or the destination mail
because of lack of permissions.RepositoryException - If there is any general repository problem.IOExceptionAutomationExceptionDatabaseExceptionUserQuotaExceededExceptionpublic void extendedCopy(String token, String mailPath, String dstId, ExtendedAttributes extAttr) throws PathNotFoundException, ItemExistsException, AccessDeniedException, RepositoryException, IOException, AutomationException, DatabaseException, UserQuotaExceededException
MailModuleextendedCopy in interface MailModulemailPath - The path that identifies an unique mail.dstId - The path of the destination mail.extAttr - Attributes to define what need to be duplicated.PathNotFoundException - If the dstPath does not exists.ItemExistsException - If there is already a mail in the
destination mail with the same name.AccessDeniedException - If there is any security problem:
you can't modify the parent mail or the destination mail
because of lack of permissions.RepositoryException - If there is any general repository problem.IOExceptionAutomationExceptionDatabaseExceptionUserQuotaExceededException@Deprecated public List<Mail> getChilds(String token, String fldId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
MailModulegetChilds in interface MailModulefldId - The path that identifies an unique folder or its UUID.PathNotFoundException - If there is no folder in the repository in this pathRepositoryException - If there is any general repository problem.AccessDeniedExceptionDatabaseExceptionpublic List<Mail> getChildren(String token, String fldId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
MailModulegetChildren in interface MailModulefldId - The path that identifies an unique folder or its UUID.PathNotFoundException - If there is no folder in the repository in this pathRepositoryException - If there is any general repository problem.AccessDeniedExceptionDatabaseExceptionpublic boolean isValid(String token, String mailId) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
MailModuleisValid in interface MailModulemailId - The path that identifies an unique mail or its UUID.PathNotFoundException - If there is no mail in the repository with this path.AccessDeniedException - If there is any security problem:
you can't access this mail because of lack of permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic String getPath(String token, String uuid) throws AccessDeniedException, RepositoryException, DatabaseException
MailModulegetPath in interface MailModuleuuid - The unique mail id.AccessDeniedException - If there is any security problem:
you can't access this folder because of lack of permissions.RepositoryException - If there is any problem.DatabaseExceptionpublic Mail importEml(String path, InputStream is) throws javax.mail.MessagingException, PathNotFoundException, ItemExistsException, VirusDetectedException, AccessDeniedException, RepositoryException, DatabaseException, UserQuotaExceededException, UnsupportedMimeTypeException, FileSizeExceededException, ExtensionException, AutomationException, IOException
public Mail importMsg(String path, InputStream is) throws javax.mail.MessagingException, PathNotFoundException, ItemExistsException, VirusDetectedException, AccessDeniedException, RepositoryException, DatabaseException, UserQuotaExceededException, UnsupportedMimeTypeException, FileSizeExceededException, ExtensionException, AutomationException, IOException
Copyright © 2019 Open Knowledge Management System S.L.. All rights reserved.