1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Rework Roster IQ and DirectoryRosterStore

remove (set|get)ItemStatus. This was always the ask status, which can
only be set to 'subscribe' or is non-existent.

Use the standard (de-)serialization facilities for DirectoryRosterStore.

Fixes Smack-657.
This commit is contained in:
Florian Schmaus 2015-09-29 22:35:50 +02:00
parent b746e5caee
commit 86548b87bb
8 changed files with 184 additions and 305 deletions

View file

@ -132,13 +132,16 @@ public final class FileUtils {
return null;
}
public static void writeFileOrThrow(File file, String content) throws IOException {
public static void writeFileOrThrow(File file, CharSequence content) throws IOException {
FileWriter writer = new FileWriter(file, false);
writer.write(content);
writer.close();
try {
writer.write(content.toString());
} finally {
writer.close();
}
}
public static boolean writeFile(File file, String content) {
public static boolean writeFile(File file, CharSequence content) {
try {
writeFileOrThrow(file, content);
return true;

View file

@ -43,6 +43,11 @@ public class ParserUtils {
assert(parser.getEventType() == XmlPullParser.START_TAG);
}
public static void assertAtStartTag(XmlPullParser parser, String name) throws XmlPullParserException {
assertAtStartTag(parser);
assert name.equals(parser.getName());
}
public static void assertAtEndTag(XmlPullParser parser) throws XmlPullParserException {
assert(parser.getEventType() == XmlPullParser.END_TAG);
}