1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

Doc: Improve javadoc

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@671 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-08-13 21:04:46 +00:00
parent 3cfc3c8b7b
commit 1679099b35
4 changed files with 29 additions and 1 deletions

View File

@ -118,6 +118,11 @@ public final class ExchangeSessionFactory {
return session; 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 { public static void checkConfig() throws IOException {
String url = Settings.getProperty("davmail.url"); String url = Settings.getProperty("davmail.url");
HttpClient httpClient = DavGatewayHttpClientFacade.getInstance(); HttpClient httpClient = DavGatewayHttpClientFacade.getInstance();
@ -187,6 +192,9 @@ public final class ExchangeSessionFactory {
return up; return up;
} }
/**
* Reset config check status and clear session pool.
*/
public static void reset() { public static void reset() {
configChecked = false; configChecked = false;
poolMap.clear(); poolMap.clear();

View File

@ -30,11 +30,19 @@ public class ICSBufferedReader extends BufferedReader {
protected String nextLine; protected String nextLine;
protected final StringBuilder currentLine = new StringBuilder(75); 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 { public ICSBufferedReader(Reader in) throws IOException {
super(in); super(in);
nextLine = super.readLine(); nextLine = super.readLine();
} }
/**
* Read a line from input reader, unwrap long lines.
*/
@Override @Override
public String readLine() throws IOException { public String readLine() throws IOException {
if (nextLine == null) { if (nextLine == null) {

View File

@ -25,6 +25,10 @@ package davmail.exchange;
public class ICSBufferedWriter { public class ICSBufferedWriter {
final StringBuilder buffer = new StringBuilder(); final StringBuilder buffer = new StringBuilder();
/**
* Write line to buffer, split lines at 75 characters.
* @param line ics event line
*/
public void writeLine(String line) { public void writeLine(String line) {
if (line.length() > 75) { if (line.length() > 75) {
buffer.append(line.substring(0, 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); buffer.append((char) 13).append((char) 10);
} }
/**
* Get buffer as String
* @return ICS content as String
*/
@Override @Override
public String toString() { public String toString() {
return buffer.toString(); return buffer.toString();

View File

@ -24,6 +24,10 @@ import davmail.exception.DavMailException;
* Custom exception to mark network down case. * Custom exception to mark network down case.
*/ */
public class NetworkDownException extends DavMailException { public class NetworkDownException extends DavMailException {
/**
* Build a network down exception with the provided BundleMessage key.
* @param key message key
*/
public NetworkDownException(String key) { public NetworkDownException(String key) {
super(key); super(key);
} }