/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param li the ListInfo for the folder * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class LI", ex); } } if (f == null) f = new IMAPFolder(li, this); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param li the ListInfo for the folder * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class LI", ex); } } if (f == null) f = new IMAPFolder(li, this); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @param isNamespace does this name represent a namespace? * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator, Boolean isNamespace) { IMAPFolder f = null; if (folderConstructor != null) { try { Object[] o = { fullName, Character.valueOf(separator), this, isNamespace }; f = (IMAPFolder)folderConstructor.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class", ex); } } if (f == null) f = new IMAPFolder(fullName, separator, this, isNamespace); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @param isNamespace does this name represent a namespace? * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator, Boolean isNamespace) { IMAPFolder f = null; if (folderConstructor != null) { try { Object[] o = { fullName, Character.valueOf(separator), this, isNamespace }; f = (IMAPFolder)folderConstructor.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class", ex); } } if (f == null) f = new IMAPFolder(fullName, separator, this, isNamespace); return f; }
public Folder getFolder(String name) throws MessagingException { return new IMAPFolder(name, UNKNOWN_SEPARATOR, (IMAPStore)store); }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { if (debug) out.println( "DEBUG IMAP: exception creating IMAPFolder class LI: " + ex.toString()); } } if (f == null) f = new IMAPFolder(li, this); return f; }
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] = new IMAPFolder(name, ns[i].delimiter, this, user == null); } return fa; }
/** * Get named folder. Returns a new, closed IMAPFolder. */ public synchronized Folder getFolder(String name) throws MessagingException { checkConnected(); return new IMAPFolder(name, IMAPFolder.UNKNOWN_SEPARATOR, this); }
public 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] = new IMAPFolder(li[i], (IMAPStore)store); return folders; }
public 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] = new IMAPFolder(li[i], (IMAPStore)store); return folders; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. */ protected IMAPFolder newIMAPFolder(String fullName, char separator, Boolean isNamespace) { IMAPFolder f = null; if (folderConstructor != null) { try { Object[] o = { fullName, new Character(separator), this, isNamespace }; f = (IMAPFolder)folderConstructor.newInstance(o); } catch (Exception ex) { if (debug) out.println( "DEBUG IMAP: exception creating IMAPFolder class: " + ex.toString()); } } if (f == null) f = new IMAPFolder(fullName, separator, this, isNamespace); return f; }
/** * Get this folder's parent. */ public synchronized Folder getParent() throws MessagingException { char c = getSeparator(); int index; if ((index = fullName.lastIndexOf(c)) != -1) return new IMAPFolder(fullName.substring(0, index), c, (IMAPStore)store); else return new DefaultFolder((IMAPStore)store); }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param li the ListInfo for the folder * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class LI", ex); } } if (f == null) f = new IMAPFolder(li, this); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param li the ListInfo for the folder * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class LI", ex); } } if (f == null) f = new IMAPFolder(li, this); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param li the ListInfo for the folder * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class LI", ex); } } if (f == null) f = new IMAPFolder(li, this); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param li the ListInfo for the folder * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(ListInfo li) { IMAPFolder f = null; if (folderConstructorLI != null) { try { Object[] o = { li, this }; f = (IMAPFolder)folderConstructorLI.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class LI", ex); } } if (f == null) f = new IMAPFolder(li, this); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @param isNamespace does this name represent a namespace? * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator, Boolean isNamespace) { IMAPFolder f = null; if (folderConstructor != null) { try { Object[] o = { fullName, Character.valueOf(separator), this, isNamespace }; f = (IMAPFolder)folderConstructor.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class", ex); } } if (f == null) f = new IMAPFolder(fullName, separator, this, isNamespace); return f; }
/** * Create an IMAPFolder object. If user supplied their own class, * use it. Otherwise, call the constructor. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @param isNamespace does this name represent a namespace? * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator, Boolean isNamespace) { IMAPFolder f = null; if (folderConstructor != null) { try { Object[] o = { fullName, Character.valueOf(separator), this, isNamespace }; f = (IMAPFolder)folderConstructor.newInstance(o); } catch (Exception ex) { logger.log(Level.FINE, "exception creating IMAPFolder class", ex); } } if (f == null) f = new IMAPFolder(fullName, separator, this, isNamespace); return f; }
/** * Get named folder. Returns a new, closed IMAPFolder. */ public synchronized Folder getFolder(URLName url) throws MessagingException { checkConnected(); return new IMAPFolder(url.getFile(), IMAPFolder.UNKNOWN_SEPARATOR, this); }
/** * Get the named subfolder. <p> */ public 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 new IMAPFolder(fullName + c + name, c, (IMAPStore)store); }