/** * Create an IMAPFolder object. Call the newIMAPFolder method * above with a null isNamespace. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator) { return newIMAPFolder(fullName, separator, null); }
/** * Create an IMAPFolder object. Call the newIMAPFolder method * above with a null isNamespace. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator) { return newIMAPFolder(fullName, separator, null); }
@Override public Folder getFolder(String name) throws MessagingException { return ((IMAPStore)store).newIMAPFolder(name, UNKNOWN_SEPARATOR); }
public Folder getFolder(String name) throws MessagingException { return ((IMAPStore)store).newIMAPFolder(name, UNKNOWN_SEPARATOR); }
/** * Get named folder. Returns a new, closed IMAPFolder. */ public synchronized Folder getFolder(String name) throws MessagingException { checkConnected(); return newIMAPFolder(name, IMAPFolder.UNKNOWN_SEPARATOR); }
/** * Get named folder. Returns a new, closed IMAPFolder. */ @Override public synchronized Folder getFolder(String name) throws MessagingException { checkConnected(); return newIMAPFolder(name, IMAPFolder.UNKNOWN_SEPARATOR); }
private Folder[] namespaceToFolders(Namespaces.Namespace[] ns, String user) { Folder[] fa = new Folder[ns.length]; for (int i = 0; i < fa.length; i++) { String name = ns[i].prefix; if (user == null) { // strip trailing delimiter int len = name.length(); if ( len > 0 && name.charAt(len - 1) == ns[i].delimiter) name = name.substring(0, len - 1); } else { // add user name += user; } fa[i] = newIMAPFolder(name, ns[i].delimiter, Boolean.valueOf(user == null)); } return fa; }
private Folder[] namespaceToFolders(Namespaces.Namespace[] ns, String user) { Folder[] fa = new Folder[ns.length]; for (int i = 0; i < fa.length; i++) { String name = ns[i].prefix; if (user == null) { // strip trailing delimiter int len = name.length(); if ( len > 0 && name.charAt(len - 1) == ns[i].delimiter) name = name.substring(0, len - 1); } else { // add user name += user; } fa[i] = newIMAPFolder(name, ns[i].delimiter, Boolean.valueOf(user == null)); } return fa; }
public synchronized Folder[] listSubscribed(final String pattern) throws MessagingException { ListInfo[] li = null; li = (ListInfo[])doCommand(new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.lsub("", pattern); } }); if (li == null) return new Folder[0]; IMAPFolder[] folders = new IMAPFolder[li.length]; for (int i = 0; i < folders.length; i++) folders[i] = ((IMAPStore)store).newIMAPFolder(li[i]); return folders; }
public synchronized Folder[] list(final String pattern) throws MessagingException { ListInfo[] li = null; li = (ListInfo[])doCommand(new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.list("", pattern); } }); if (li == null) return new Folder[0]; IMAPFolder[] folders = new IMAPFolder[li.length]; for (int i = 0; i < folders.length; i++) folders[i] = ((IMAPStore)store).newIMAPFolder(li[i]); return folders; }
@Override public synchronized Folder[] list(final String pattern) throws MessagingException { ListInfo[] li = null; li = (ListInfo[])doCommand(new ProtocolCommand() { @Override public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.list("", pattern); } }); if (li == null) return new Folder[0]; IMAPFolder[] folders = new IMAPFolder[li.length]; for (int i = 0; i < folders.length; i++) folders[i] = ((IMAPStore)store).newIMAPFolder(li[i]); return folders; }
@Override public synchronized Folder[] listSubscribed(final String pattern) throws MessagingException { ListInfo[] li = null; li = (ListInfo[])doCommand(new ProtocolCommand() { @Override public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.lsub("", pattern); } }); if (li == null) return new Folder[0]; IMAPFolder[] folders = new IMAPFolder[li.length]; for (int i = 0; i < folders.length; i++) folders[i] = ((IMAPStore)store).newIMAPFolder(li[i]); return folders; }
/** * Get this folder's parent. */ public synchronized Folder getParent() throws MessagingException { char c = getSeparator(); int index; if ((index = fullName.lastIndexOf(c)) != -1) return ((IMAPStore)store).newIMAPFolder( fullName.substring(0, index), c); else return new DefaultFolder((IMAPStore)store); }
/** * Get this folder's parent. */ @Override public synchronized Folder getParent() throws MessagingException { char c = getSeparator(); int index; if ((index = fullName.lastIndexOf(c)) != -1) return ((IMAPStore)store).newIMAPFolder( fullName.substring(0, index), c); else return new DefaultFolder((IMAPStore)store); }
/** * Get named folder. Returns a new, closed IMAPFolder. */ public synchronized Folder getFolder(URLName url) throws MessagingException { checkConnected(); return newIMAPFolder(url.getFile(), IMAPFolder.UNKNOWN_SEPARATOR); }
/** * Get named folder. Returns a new, closed IMAPFolder. */ @Override public synchronized Folder getFolder(URLName url) throws MessagingException { checkConnected(); return newIMAPFolder(url.getFile(), IMAPFolder.UNKNOWN_SEPARATOR); }
/** * Get the named subfolder. */ public synchronized Folder getFolder(String name) throws MessagingException { // If we know that this folder is *not* a directory, don't // send the request to the server at all ... if (attributes != null && !isDirectory()) throw new MessagingException("Cannot contain subfolders"); char c = getSeparator(); return ((IMAPStore)store).newIMAPFolder(fullName + c + name, c); }
/** * Get the named subfolder. */ @Override public synchronized Folder getFolder(String name) throws MessagingException { // If we know that this folder is *not* a directory, don't // send the request to the server at all ... if (attributes != null && !isDirectory()) throw new MessagingException("Cannot contain subfolders"); char c = getSeparator(); return ((IMAPStore)store).newIMAPFolder(fullName + c + name, c); }
IMAPStore st = (IMAPStore)store; for (int i = start; i < li.length; i++) folders[i-start] = st.newIMAPFolder(li[i]); return folders;
IMAPStore st = (IMAPStore)store; for (int i = start; i < li.length; i++) folders[i-start] = st.newIMAPFolder(li[i]); return folders;