mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 22:12:05 +01:00
0 byte file causes file transfer to fail
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3471 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
665bf172f7
commit
3f9cf661ea
1 changed files with 10 additions and 1 deletions
|
@ -81,7 +81,16 @@ public class StreamInitiationProvider implements IQProvider {
|
||||||
if (elementName.equals("si")) {
|
if (elementName.equals("si")) {
|
||||||
done = true;
|
done = true;
|
||||||
} else if (elementName.equals("file")) {
|
} else if (elementName.equals("file")) {
|
||||||
File file = new File(name, Long.parseLong(size));
|
long fileSize = 0;
|
||||||
|
if(size != null && size.trim().length() !=0){
|
||||||
|
try {
|
||||||
|
fileSize = Long.parseLong(size);
|
||||||
|
}
|
||||||
|
catch (NumberFormatException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
File file = new File(name, fileSize);
|
||||||
file.setHash(hash);
|
file.setHash(hash);
|
||||||
if (date != null)
|
if (date != null)
|
||||||
file.setDate(DelayInformation.UTC_FORMAT.parse(date));
|
file.setDate(DelayInformation.UTC_FORMAT.parse(date));
|
||||||
|
|
Loading…
Reference in a new issue