From 1679099b3507309d34b1166992fb601d56720c2e Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 13 Aug 2009 21:04:46 +0000 Subject: [PATCH] Doc: Improve javadoc git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@671 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSessionFactory.java | 8 ++++++++ src/java/davmail/exchange/ICSBufferedReader.java | 8 ++++++++ src/java/davmail/exchange/ICSBufferedWriter.java | 10 +++++++++- src/java/davmail/exchange/NetworkDownException.java | 4 ++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/exchange/ExchangeSessionFactory.java b/src/java/davmail/exchange/ExchangeSessionFactory.java index eca061ad..aece22f2 100644 --- a/src/java/davmail/exchange/ExchangeSessionFactory.java +++ b/src/java/davmail/exchange/ExchangeSessionFactory.java @@ -118,6 +118,11 @@ public final class ExchangeSessionFactory { return session; } + /** + * Send a request to Exchange server to check current settings. + * + * @throws IOException if unable to access Exchange server + */ public static void checkConfig() throws IOException { String url = Settings.getProperty("davmail.url"); HttpClient httpClient = DavGatewayHttpClientFacade.getInstance(); @@ -187,6 +192,9 @@ public final class ExchangeSessionFactory { return up; } + /** + * Reset config check status and clear session pool. + */ public static void reset() { configChecked = false; poolMap.clear(); diff --git a/src/java/davmail/exchange/ICSBufferedReader.java b/src/java/davmail/exchange/ICSBufferedReader.java index 6eb182f8..cf37ce94 100644 --- a/src/java/davmail/exchange/ICSBufferedReader.java +++ b/src/java/davmail/exchange/ICSBufferedReader.java @@ -30,11 +30,19 @@ public class ICSBufferedReader extends BufferedReader { protected String nextLine; protected final StringBuilder currentLine = new StringBuilder(75); + /** + * Create an ICS reader on the provided reader + * @param in input reader + * @throws IOException on error + */ public ICSBufferedReader(Reader in) throws IOException { super(in); nextLine = super.readLine(); } + /** + * Read a line from input reader, unwrap long lines. + */ @Override public String readLine() throws IOException { if (nextLine == null) { diff --git a/src/java/davmail/exchange/ICSBufferedWriter.java b/src/java/davmail/exchange/ICSBufferedWriter.java index 6af0312e..b5824c87 100644 --- a/src/java/davmail/exchange/ICSBufferedWriter.java +++ b/src/java/davmail/exchange/ICSBufferedWriter.java @@ -25,6 +25,10 @@ package davmail.exchange; public class ICSBufferedWriter { final StringBuilder buffer = new StringBuilder(); + /** + * Write line to buffer, split lines at 75 characters. + * @param line ics event line + */ public void writeLine(String line) { if (line.length() > 75) { buffer.append(line.substring(0, 75)); @@ -37,10 +41,14 @@ public class ICSBufferedWriter { } } - public void newLine() { + protected void newLine() { buffer.append((char) 13).append((char) 10); } + /** + * Get buffer as String + * @return ICS content as String + */ @Override public String toString() { return buffer.toString(); diff --git a/src/java/davmail/exchange/NetworkDownException.java b/src/java/davmail/exchange/NetworkDownException.java index 0a177887..b92d390f 100644 --- a/src/java/davmail/exchange/NetworkDownException.java +++ b/src/java/davmail/exchange/NetworkDownException.java @@ -24,6 +24,10 @@ import davmail.exception.DavMailException; * Custom exception to mark network down case. */ public class NetworkDownException extends DavMailException { + /** + * Build a network down exception with the provided BundleMessage key. + * @param key message key + */ public NetworkDownException(String key) { super(key); }