git://git.nikiroo.be
/
jvcard.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some sync issues
[jvcard.git]
/
src
/
be
/
nikiroo
/
jvcard
/
Card.java
diff --git
a/src/be/nikiroo/jvcard/Card.java
b/src/be/nikiroo/jvcard/Card.java
index de5ab67a604207f0d294f3d9a7652a460c4754a3..52eec8c6e4af0d5ac3ae67dbb94f7d63b93f0f37 100644
(file)
--- a/
src/be/nikiroo/jvcard/Card.java
+++ b/
src/be/nikiroo/jvcard/Card.java
@@
-42,10
+42,8
@@
public class Card extends BaseClass<Contact> {
public Card(File file, Format format) throws IOException {
this(Parser.parse(file, format));
public Card(File file, Format format) throws IOException {
this(Parser.parse(file, format));
- if (file != null) {
- if (file.exists()) {
- lastModified = file.lastModified();
- }
+ if (file != null && file.exists()) {
+ lastModified = file.lastModified();
}
this.format = format;
}
this.format = format;
@@
-136,7
+134,9
@@
public class Card extends BaseClass<Contact> {
return false;
this.replaceListContent(Parser.parse(file, format));
return false;
this.replaceListContent(Parser.parse(file, format));
+ lastModified = file.lastModified();
setPristine();
setPristine();
+
return true;
}
return true;
}
@@
-150,7
+150,12
@@
public class Card extends BaseClass<Contact> {
* @return the {@link String}
*/
public String toString(Format format) {
* @return the {@link String}
*/
public String toString(Format format) {
- return Parser.toString(this, format);
+ StringBuilder builder = new StringBuilder();
+ for (String line : Parser.toStrings(this, format)) {
+ builder.append(line);
+ builder.append("\r\n");
+ }
+ return builder.toString();
}
/**
}
/**