Skip to content

Commit 438c90d

Browse files
rsafonsecayadvr
authored andcommitted
Fix findbugs encoding warning in HttpNfcLeaseMO VMWare ovf files are utf-8 encoded. Relying on default encoding in some platforms such as windows would cause erroneous characters from being read on some fields like description, and could also cause the import to fail, depending on the characters.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> This closes apache#397
1 parent cc6d28f commit 438c90d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎vmware-base/src/com/cloud/hypervisor/vmware/mo/HttpNfcLeaseMO.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static long calcTotalBytes(OvfCreateImportSpecResult ovfImportResult) {
121121

122122
public static String readOvfContent(String ovfFilePath) throws IOException {
123123
StringBuffer strContent = new StringBuffer();
124-
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(ovfFilePath)));
124+
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(ovfFilePath),"UTF-8"));
125125
String lineStr;
126126
while ((lineStr = in.readLine()) != null) {
127127
strContent.append(lineStr);

0 commit comments

Comments
 (0)