修复stream未关闭,导致rename file失败的问题
This commit is contained in:
parent
863739ea27
commit
cc1ba504e7
|
|
@ -25,8 +25,9 @@ public class ManifestParser {
|
||||||
System.out.println(" manifest file not exist!!! filePath -> " + filePath);
|
System.out.println(" manifest file not exist!!! filePath -> " + filePath);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
FileInputStream inputStream = null;
|
||||||
try {
|
try {
|
||||||
FileInputStream inputStream = new FileInputStream(file);
|
inputStream = new FileInputStream(file);
|
||||||
|
|
||||||
parser.open(inputStream);
|
parser.open(inputStream);
|
||||||
|
|
||||||
|
|
@ -65,6 +66,14 @@ public class ManifestParser {
|
||||||
} catch (XmlPullParserException | IOException e) {
|
} catch (XmlPullParserException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.out.println("parseManifestFile failed, reason --> " + e.getMessage());
|
System.out.println("parseManifestFile failed, reason --> " + e.getMessage());
|
||||||
|
} finally {
|
||||||
|
if (inputStream != null) {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new Pair(packageName, applicationName);
|
return new Pair(packageName, applicationName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue