*/
package org.tizen.cli.exec;
+import static org.tizen.sdblib.util.IOUtil.tryClose;
+
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
{
final URL url = iter.nextElement();
logger.trace( "URL :{}", url );
- final Properties properties = PropertyUtil.loadProperties( url.openStream() );
- logger.debug( "Properties :{}", properties );
-
- for ( final Object key : properties.keySet() )
+ final InputStream in = url.openStream();
+ try
+ {
+ final Properties properties = PropertyUtil.loadProperties( in );
+ logger.debug( "Properties :{}", properties );
+
+ for ( final Object key : properties.keySet() )
+ {
+ final String value = properties.getProperty( (String) key );
+ byte[] contents = IOUtil.getBytes( cl.getResourceAsStream( value ), true );
+ this.help.addHelpDetail( (String) key, new String( contents, Charset.forName( "utf8" ) ) );
+ }
+ }
+ finally
{
- final String value = properties.getProperty( (String) key );
- byte[] contents = IOUtil.getBytes( cl.getResourceAsStream( value ), true );
- this.help.addHelpDetail( (String) key, new String( contents, Charset.forName( "utf8" ) ) );
+ tryClose( in );
}
}
}