]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/Activator.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.spreadsheet.common / src / org / simantics / spreadsheet / common / Activator.java
index 5eda19ef39bbe42bd739fd914285b6f04bf47636..ec88dcef9f3af1f86469838728bc08a13c90dff5 100644 (file)
@@ -1,82 +1,82 @@
-package org.simantics.spreadsheet.common;\r
-import java.io.File;\r
-import java.io.UnsupportedEncodingException;\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-import java.net.URLDecoder;\r
-\r
-import org.osgi.framework.BundleActivator;\r
-import org.osgi.framework.BundleContext;\r
-\r
-\r
-public class Activator implements BundleActivator {\r
-\r
-       /**\r
-        * Name of the log file. \r
-        */\r
-       public static String LOG_FILE_NAME = "spreadsheet.log";\r
-\r
-       // The plug-in ID\r
-       public static final String BUNDLE_ID = "org.simantics.spreadsheet.common"; //$NON-NLS-1$\r
-\r
-       // The shared instance\r
-       private static Activator plugin;\r
-\r
-       /**\r
-        * The constructor\r
-        */\r
-       public Activator() {\r
-       }\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)\r
-        */\r
-       @Override\r
-       public void start(BundleContext context) throws Exception {\r
-               plugin = this;\r
-\r
-               String prop = System.getProperty("osgi.instance.area", null);\r
-               if (prop != null) {\r
-                       try {\r
-                               URL url = new URL(prop);\r
-                               if ("file".equals(url .getProtocol())) {\r
-                                       try {\r
-                                               File path = new File(URLDecoder.decode(url.getPath(), "UTF-8"));\r
-                                               if (!path.exists())\r
-                                                       path.mkdirs();\r
-                                               if (path.exists() && path.canWrite()) {\r
-                                                       File logFile = new File(path, LOG_FILE_NAME);\r
-                                                       if (!logFile.exists() || (logFile.isFile() && logFile.canWrite()))\r
-                                                               LOG_FILE_NAME = logFile.getAbsolutePath();\r
-\r
-                                               }\r
-                                       } catch (UnsupportedEncodingException e) {\r
-                                               // Should never happen since UTF-8 is always supported.\r
-                                       }\r
-                               }\r
-                       } catch (MalformedURLException e) {\r
-                               // Ignore.\r
-                       }\r
-               }\r
-       }\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)\r
-        */\r
-       @Override\r
-       public void stop(BundleContext context) throws Exception {\r
-               plugin = null;\r
-       }\r
-\r
-       /**\r
-        * Returns the shared instance\r
-        *\r
-        * @return the shared instance\r
-        */\r
-       public static Activator getDefault() {\r
-               return plugin;\r
-       }\r
-\r
+package org.simantics.spreadsheet.common;
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+
+public class Activator implements BundleActivator {
+
+       /**
+        * Name of the log file. 
+        */
+       public static String LOG_FILE_NAME = "spreadsheet.log";
+
+       // The plug-in ID
+       public static final String BUNDLE_ID = "org.simantics.spreadsheet.common"; //$NON-NLS-1$
+
+       // The shared instance
+       private static Activator plugin;
+
+       /**
+        * The constructor
+        */
+       public Activator() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+        */
+       @Override
+       public void start(BundleContext context) throws Exception {
+               plugin = this;
+
+               String prop = System.getProperty("osgi.instance.area", null);
+               if (prop != null) {
+                       try {
+                               URL url = new URL(prop);
+                               if ("file".equals(url .getProtocol())) {
+                                       try {
+                                               File path = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
+                                               if (!path.exists())
+                                                       path.mkdirs();
+                                               if (path.exists() && path.canWrite()) {
+                                                       File logFile = new File(path, LOG_FILE_NAME);
+                                                       if (!logFile.exists() || (logFile.isFile() && logFile.canWrite()))
+                                                               LOG_FILE_NAME = logFile.getAbsolutePath();
+
+                                               }
+                                       } catch (UnsupportedEncodingException e) {
+                                               // Should never happen since UTF-8 is always supported.
+                                       }
+                               }
+                       } catch (MalformedURLException e) {
+                               // Ignore.
+                       }
+               }
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+        */
+       @Override
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+       }
+
+       /**
+        * Returns the shared instance
+        *
+        * @return the shared instance
+        */
+       public static Activator getDefault() {
+               return plugin;
+       }
+
 }
\ No newline at end of file