OSDN Git Service

refs #344 インストールのとき,依存ライブラリも一緒にプラグインディレクトリへコピーするように変更した.
[stigmata/stigmata.git] / src / main / java / jp / sourceforge / stigmata / command / LicenseCommand.java
index 17ba7e6..d819669 100644 (file)
@@ -19,18 +19,27 @@ public class LicenseCommand extends AbstractStigmataCommand{
     }
 
     @Override
-    public void perform(Stigmata stigmata, BirthmarkContext context, String[] args){
+    public boolean perform(Stigmata stigmata, BirthmarkContext context, String[] args){
+        BufferedReader reader = null;
         try{
             InputStream in = getClass().getResourceAsStream("/META-INF/license.txt");
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+            reader = new BufferedReader(new InputStreamReader(in));
             String line;
 
             while((line = reader.readLine()) != null){
                 System.out.println(line);
             }
             reader.close();
+            return true;
         }catch(IOException ex){
-            ex.printStackTrace();
+            return false;
+        } finally{
+            if(reader != null){
+                try{
+                    reader.close();
+                } catch(IOException e){
+                }
+            }
         }
     }
 }