Package com.googlecode.gmail4j

Examples of com.googlecode.gmail4j.GmailException


    @Override
    public void setSubject(final String subject) {
        try {
            source.setSubject(subject);
        } catch (final Exception e) {
            throw new GmailException("Failed setting subject", e);
        }
    }
View Full Code Here


    @Override
    public String getSubject() {
        try {
            return source.getSubject();
        } catch (final Exception e) {
            throw new GmailException("Failed getting message subject", e);
        }
    }
View Full Code Here

    @Override
    public void setContentText(final String contentText) {
        try {
            source.setText(contentText);
        } catch (final Exception e) {
            throw new GmailException("Failed settting content text", e);
        }
    }
View Full Code Here

    @Override
    public int getMessageNumber() {
        try {
            return source.getMessageNumber();
        } catch (final Exception e) {
            throw new GmailException("Failed getting message number", e);
        }
    }
View Full Code Here

                        }
                    }
                }
            }
        } catch (final Exception e) {
            throw new GmailException("Failed getting message header information", e);
        }
        return headerInfo;
    }
View Full Code Here

     * @throws GmailException in case username and/or password are missing.
     */
    public void validate() {
        if (username == null || username.length() == 0
                || password == null || password.length == 0) {
            throw new GmailException("No username and/or password provided");
        }
    }
View Full Code Here

        }
        log.debug("Trying to connect to proxy");
        ProxyClient.ConnectResponse resp = proxyClient.connect();
        if (resp.getConnectMethod().getStatusCode() != HttpStatus.SC_OK) {
            log.error("Failed to connect. " + resp.getConnectMethod().getStatusLine());
            throw new GmailException("Failed connecting to IMAP through proxy: "
                    + resp.getConnectMethod().getStatusLine());
        }
        log.debug("Connected, returning socket");
        return resp.getSocket();
    }
View Full Code Here

     */
    public void setUrl(final String url) {
        try {
            this.url = new URL(url);
        } catch (final MalformedURLException e) {
            throw new GmailException("Failed creating Gmail connection", e);
        }
    }
View Full Code Here

                return url.openConnection(proxy);
            } else {
                return url.openConnection();
            }
        } catch (final Exception e) {
            throw new GmailException("Failed opening Gmail connection", e);
        }
    }
View Full Code Here

                found.add(new JavaMailGmailMessage(msg));
            }
            LOG.debug("Found " + found.size() + " emails");
            return found;
        } catch (final Exception e) {
            throw new GmailException("Failed getting unread messages", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.googlecode.gmail4j.GmailException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.