Commit 7893c474 authored by Ricki Hirner's avatar Ricki Hirner

Merge branch 'master' of https://gitlab.com/bitfireAT/dav4android

parents 5308625f 105766df
......@@ -4,6 +4,6 @@ import java.util.logging.Logger;
public class Constants {
public static final Logger log = Logger.getLogger("davdroid.dav4android");
public static Logger log = Logger.getLogger("dav4android");
}
package at.bitfire.dav4android;
import java.util.logging.Logger;
import lombok.NonNull;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
public class DavCollection extends DavResource {
public DavCollection(@NonNull OkHttpClient httpClient, @NonNull HttpUrl location) {
super(httpClient, location);
}
}
......@@ -561,7 +561,7 @@ public class DavResource {
if (property != null)
prop.put(name, property);
else
log.fine("Ignoring unknown/unparseable property " + name);
log.fine("Ignoring unknown property " + name);
}
eventType = parser.next();
}
......
......@@ -15,7 +15,7 @@ public class PropertyRegistry {
private PropertyRegistry() {
Constants.log.info("Registering DAV property factories");
for (PropertyFactory factory : ServiceLoader.load(PropertyFactory.class)) {
Constants.log.info("Registering " + factory.getClass().getName() + " for " + factory.getName());
Constants.log.fine("Registering " + factory.getClass().getName() + " for " + factory.getName());
register(factory);
}
}
......
/*
* Copyright © 2013 – 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package at.bitfire.dav4android.property;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import at.bitfire.dav4android.Constants;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import lombok.ToString;
import okhttp3.internal.http.HttpDate;
@ToString
public class GetLastModified implements Property {
public static final Name NAME = new Name(XmlUtils.NS_WEBDAV, "getlastmodified");
public Long lastModified;
private GetLastModified() {}
public GetLastModified(String rawDate)
{
Date date = HttpDate.parse(rawDate);
if (date != null)
lastModified = date.getTime();
else
Constants.log.warning("Couldn't parse Last-Modified date");
}
public static class Factory implements PropertyFactory {
@Override
public Name getName() {
return NAME;
}
@Override
public GetLastModified create(XmlPullParser parser) {
// <!ELEMENT getlastmodified (#PCDATA) >
try {
return new GetLastModified(parser.nextText());
} catch(XmlPullParserException|IOException e) {
Constants.log.log(Level.SEVERE, "Couldn't parse <getlastmodified>", e);
return null;
}
}
}
}
......@@ -14,6 +14,7 @@ at.bitfire.dav4android.property.DisplayName$Factory
at.bitfire.dav4android.property.GetContentType$Factory
at.bitfire.dav4android.property.GetCTag$Factory
at.bitfire.dav4android.property.GetETag$Factory
at.bitfire.dav4android.property.GetLastModified$Factory
at.bitfire.dav4android.property.GroupMembership$Factory
at.bitfire.dav4android.property.ResourceType$Factory
at.bitfire.dav4android.property.SupportedAddressData$Factory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment