mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 13:32:07 +01:00
Use BufferedReader to read version
This commit is contained in:
parent
1d21285d24
commit
1f6d0fa415
1 changed files with 9 additions and 4 deletions
|
@ -17,8 +17,10 @@
|
|||
|
||||
package org.jivesoftware.smack;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -95,10 +97,13 @@ public final class SmackConfiguration {
|
|||
static {
|
||||
String smackVersion;
|
||||
try {
|
||||
InputStream is = FileUtils.getStreamForUrl("classpath:org.jivesoftware.smack/version", null);
|
||||
byte[] buf = new byte[1024];
|
||||
is.read(buf);
|
||||
smackVersion = new String(buf, "UTF-8");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(FileUtils.getStreamForUrl("classpath:org.jivesoftware.smack/version", null)));
|
||||
smackVersion = reader.readLine();
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
LOGGER.log(Level.WARNING, "IOException closing stream", e);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
LOGGER.log(Level.SEVERE, "Could not determine Smack version", e);
|
||||
smackVersion = "unkown";
|
||||
|
|
Loading…
Reference in a new issue