}
};
}
+
InputStream in = getFileHandler().read( profilesFilePath );
+ String version = null;
try {
- String version = container.readProfileXML( in );
+ version = container.readProfileXML( in );
if ( version == null ) {
getPrompter().error( "Cannot load profiles in " + profilesFilePath );
return false;
}
-
- // if old version, rewrite to new version.
- if ( StringUtil.isEmpty( version ) ) {
- getPrompter().notify( "Old version profile detected. Converting this automatically." );
-
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- container.writeProfileXML( outStream );
- InputStream inForOut = new ByteArrayInputStream( outStream.toByteArray() );
-
- try {
- getFileHandler().write( profilesFilePath, inForOut );
- } finally {
- tryClose( inForOut );
- }
- }
} finally {
IOUtil.tryClose( in );
}
+ // if old version, rewrite to new version.
+ if ( StringUtil.isEmpty( version ) ) {
+ getPrompter().notify( "Old version profile detected. Converting this automatically." );
+
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ container.writeProfileXML( outStream );
+ InputStream inForOut = new ByteArrayInputStream( outStream.toByteArray() );
+
+ try {
+ getFileHandler().write( profilesFilePath, inForOut );
+ } finally {
+ tryClose( inForOut );
+ }
+ }
+
return true;
}