registered org extension
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Wed, 8 Oct 2014 07:59:28 +0000 (10:59 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Wed, 8 Oct 2014 07:59:28 +0000 (10:59 +0300)
src/main/java/eu/svjatoslav/instantlauncher/FileAssociationManager.java

index 6752594..4d1ec06 100755 (executable)
@@ -36,15 +36,18 @@ public class FileAssociationManager {
             final String[] commands = extensionToApplication.get(fileExtension);
             runOpeningApplication(file, commands);
             return true;
-        } else
-            return false;
+        } else {
+                       return false;
+               }
 
     }
 
        private static void runOpeningApplication(final File file, final String[] commands) {
-               for (int i = 0; i < commands.length; i++)
-                   if (commands[i].equals(FILE_INDICATOR))
-                       commands[i] = file.getAbsolutePath();
+               for (int i = 0; i < commands.length; i++) {
+                       if (commands[i].equals(FILE_INDICATOR)) {
+                               commands[i] = file.getAbsolutePath();
+                       }
+               }
 
                try {
                    Runtime.getRuntime().exec(commands);
@@ -56,9 +59,15 @@ public class FileAssociationManager {
        }
 
        private static boolean isLogFile(String fileName) {
-               if (fileName.endsWith(".out")) return true;
-               if (fileName.endsWith(".log")) return true;
-               if (fileName.contains(".log.")) return true;
+               if (fileName.endsWith(".out")) {
+                       return true;
+               }
+               if (fileName.endsWith(".log")) {
+                       return true;
+               }
+               if (fileName.contains(".log.")) {
+                       return true;
+               }
                
                return false;
        }
@@ -67,6 +76,7 @@ public class FileAssociationManager {
 
         extensionToApplication.put("txt", new String[] { TEXT_EDITOR, FILE_INDICATOR });
         extensionToApplication.put("xml", new String[] { TEXT_EDITOR, FILE_INDICATOR });
+               extensionToApplication.put("org", new String[] { TEXT_EDITOR, FILE_INDICATOR });
         extensionToApplication.put("properties", new String[] { TEXT_EDITOR, FILE_INDICATOR });
         extensionToApplication.put("ini", new String[] { TEXT_EDITOR, FILE_INDICATOR });
         extensionToApplication.put("", new String[] { TEXT_EDITOR, FILE_INDICATOR });