Fixes from audit

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@418 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-04 22:05:26 +00:00
parent e2f7003425
commit 25a06bb3e8
7 changed files with 5 additions and 49 deletions

View File

@ -790,7 +790,7 @@ public class CaldavConnection extends AbstractConnection {
}
protected static class CaldavResponse {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter writer;
public CaldavResponse() throws IOException {

View File

@ -658,19 +658,9 @@ public class ExchangeSession {
if ("nosubs".equals(property.getLocalName())) {
folder.noInferiors = "1".equals(property.getPropertyAsString());
}
if ("objectcount".equals(property.getLocalName())) {
folder.objectCount = Integer.parseInt(property.getPropertyAsString());
}
if ("unreadcount".equals(property.getLocalName())) {
folder.unreadCount = Integer.parseInt(property.getPropertyAsString());
}
if ("getlastmodified".equals(property.getLocalName())) {
try {
folder.lastModified = dateParser.parse(property.getPropertyAsString()).getTime();
} catch (ParseException e) {
LOGGER.error("Unable to parse date: " + e);
}
}
}
if (href.endsWith("/")) {
href = href.substring(0, href.length() - 1);
@ -847,9 +837,7 @@ public class ExchangeSession {
Vector<String> reqProps = new Vector<String>();
reqProps.add("DAV:hassubs");
reqProps.add("DAV:nosubs");
reqProps.add("DAV:objectcount");
reqProps.add("urn:schemas:httpmail:unreadcount");
reqProps.add("DAV:getlastmodified");
Enumeration folderEnum = wdr.propfindMethod(getFolderPath(folderName), 0, reqProps);
Folder folder = null;
if (folderEnum.hasMoreElements()) {
@ -926,11 +914,9 @@ public class ExchangeSession {
public static class Folder {
public String folderUrl;
public int objectCount;
public int unreadCount;
public boolean hasChildren;
public boolean noInferiors;
public long lastModified;
public String folderName;
public String getFlags() {
@ -1120,13 +1106,6 @@ public class ExchangeSession {
return super.add(message);
}
public Message getByUid(long uid) {
return uidMessageMap.get(uid);
}
}
public WebdavResource getWebDavResource() {
return wdr;
}
public class Event {
@ -1154,7 +1133,6 @@ public class ExchangeSession {
public String getICS() throws IOException {
String result = null;
LOGGER.debug("Get event: " + href);
StringBuilder buffer = new StringBuilder();
GetMethod method = new GetMethod(URIUtil.encodePath(href));
method.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
method.setRequestHeader("Translate", "f");

View File

@ -12,11 +12,6 @@ public class ICSBufferedReader extends BufferedReader {
protected String nextLine;
protected final StringBuilder currentLine = new StringBuilder(75);
public ICSBufferedReader(Reader in, int sz) throws IOException {
super(in, sz);
nextLine = super.readLine();
}
public ICSBufferedReader(Reader in) throws IOException {
super(in);
nextLine = super.readLine();

View File

@ -360,7 +360,7 @@ public class ImapConnection extends AbstractConnection {
answer.append("RECENT ").append(localMessages.size()).append(" ");
}
if ("UIDNEXT".equalsIgnoreCase(token)) {
if (folder.objectCount == 0) {
if (localMessages.size() == 0) {
answer.append("UIDNEXT 1 ");
} else {
if (localMessages.size() == 0) {
@ -839,8 +839,8 @@ public class ImapConnection extends AbstractConnection {
protected int state = START;
protected int size = 0;
protected boolean writeHeaders;
protected boolean writeBody;
protected final boolean writeHeaders;
protected final boolean writeBody;
public PartOutputStream(OutputStream os, boolean writeHeaders, boolean writeBody) {
super(os);
@ -848,10 +848,6 @@ public class ImapConnection extends AbstractConnection {
this.writeBody = writeBody;
}
public int size() {
return size;
}
@Override
public void write(int b) throws IOException {
size++;

View File

@ -43,12 +43,6 @@ public class DavGatewayTray {
}
}
public static void inactiveIcon() {
if (davGatewayTray != null) {
davGatewayTray.inactiveIcon();
}
}
public static boolean isActive() {
return davGatewayTray == null || davGatewayTray.isActive();
}

View File

@ -2,7 +2,6 @@ package davmail.ui;
import davmail.tray.DavGatewayTray;
import javax.swing.event.HyperlinkEvent;
import java.net.URI;
import java.net.URISyntaxException;
@ -56,11 +55,4 @@ public final class DesktopBrowser {
}
}
public static void browse(HyperlinkEvent hle) {
try {
DesktopBrowser.browse(hle.getURL().toURI());
} catch (URISyntaxException e) {
DavGatewayTray.error("Unable to open link", e);
}
}
}

View File

@ -12,6 +12,7 @@ import java.awt.event.ActionListener;
*/
public class OSXFrameGatewayTray extends FrameGatewayTray {
@SuppressWarnings({"SameReturnValue"})
public boolean quit() {
return true;
}