Various fixes from audit

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@211 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2008-12-05 14:53:38 +00:00
parent 669fe2f131
commit 30e4bb903b
6 changed files with 24 additions and 17 deletions

View File

@ -113,8 +113,8 @@ public class DavGateway {
versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream()));
version = versionReader.readLine();
}
} catch (Exception e) {
// ignore
} catch (IOException e) {
DavGatewayTray.debug("Exception getting released version",e);
} finally {
if (versionReader != null) {
try {

View File

@ -798,10 +798,10 @@ public class ExchangeSession {
public List<Event> getAllEvents() throws IOException {
int caldavPastDelay = Settings.getIntProperty("davmail.caldavPastDelay", 90);
String dateCondition = "";
if(caldavPastDelay != 0) {
if (caldavPastDelay != 0) {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -caldavPastDelay);
dateCondition = " AND \"urn:schemas:calendar:dtstart\" > '"+dateFormatter.format(cal.getTime())+"'\n";
dateCondition = " AND \"urn:schemas:calendar:dtstart\" > '" + dateFormatter.format(cal.getTime()) + "'\n";
}
List<Event> events = new ArrayList<Event>();
@ -992,11 +992,13 @@ public class ExchangeSession {
/**
* Search users in global address book
*
* @param searchValue
* @param searchAttribute exchange search attribute
* @param searchValue search value
* @return List of users
* @throws java.io.IOException on error
*/
public Map<String, Map<String, String>> galFind(String searchAttribute, String searchValue) throws IOException {
Map<String, Map<String, String>> results = new HashMap<String, Map<String, String>>();
Map<String, Map<String, String>> results;
GetMethod getMethod = new GetMethod(URIUtil.encodePathQuery("/public/?Cmd=galfind&" + searchAttribute + "=" + searchValue));
try {
int status = wdr.retrieveSessionInstance().executeMethod(getMethod);

View File

@ -74,6 +74,9 @@ public class ExchangeSessionFactory {
}
}
private ExchangeSessionFactory() {
}
/**
* Create authenticated Exchange session
*

View File

@ -6,15 +6,13 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Map;
/**
* XmlStreamReader utility methods
*/
public class XMLStreamUtil {
public final class XMLStreamUtil {
private XMLStreamUtil() {
}

View File

@ -31,6 +31,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
private static Display display;
private static Shell shell;
private boolean isActive = true;
private boolean isReady = false;
public java.awt.Image getFrameIcon() {
return awtImage;
@ -257,6 +258,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
settingsFrame.setVisible(true);
}
// ready
isReady = true;
synchronized (mainThread) {
mainThread.notify();
}
@ -277,13 +279,15 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
}
}
}.start();
// wait for SWT init
try {
synchronized (mainThread) {
mainThread.wait();
while (!isReady) {
// wait for SWT init
try {
synchronized (mainThread) {
mainThread.wait(1000);
}
} catch (InterruptedException e) {
DavGatewayTray.error("Error waiting for SWT init", e);
}
} catch (InterruptedException e) {
DavGatewayTray.error("Error waiting for SWT init",e);
}
}

View File

@ -48,7 +48,7 @@
<img src="images/thunderbirdCalendar5.png"/>
</div>
<p>Proceeed to <a href="thunderbirddirectorysetup.html">Thunderbird calendar setup</a></p>
<p>Proceeed to <a href="thunderbirddirectorysetup.html">Thunderbird directory setup</a></p>
</section>
</section>
</body>