From b11dafc7f892a9554cf612fb669f429ab9e25f5b Mon Sep 17 00:00:00 2001
From: richie <richie@fanruan.com>
Date: Fri, 30 Aug 2019 14:58:38 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6API?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../fanruan/api/{env => runtime}/EnvKit.java  |  2 +-
 .../com/fanruan/api/runtime/PluginKit.java    | 20 +++++++++++++++++++
 .../api/{env => runtime}/EnvKitTest.java      |  2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)
 rename src/main/java/com/fanruan/api/{env => runtime}/EnvKit.java (97%)
 create mode 100644 src/main/java/com/fanruan/api/runtime/PluginKit.java
 rename src/test/java/com/fanruan/api/{env => runtime}/EnvKitTest.java (97%)

diff --git a/src/main/java/com/fanruan/api/env/EnvKit.java b/src/main/java/com/fanruan/api/runtime/EnvKit.java
similarity index 97%
rename from src/main/java/com/fanruan/api/env/EnvKit.java
rename to src/main/java/com/fanruan/api/runtime/EnvKit.java
index bf24b3e..95e6ef2 100644
--- a/src/main/java/com/fanruan/api/env/EnvKit.java
+++ b/src/main/java/com/fanruan/api/runtime/EnvKit.java
@@ -1,4 +1,4 @@
-package com.fanruan.api.env;
+package com.fanruan.api.runtime;
 
 import com.fr.stable.project.ProjectConstants;
 import com.fr.workspace.WorkContext;
diff --git a/src/main/java/com/fanruan/api/runtime/PluginKit.java b/src/main/java/com/fanruan/api/runtime/PluginKit.java
new file mode 100644
index 0000000..c6f126b
--- /dev/null
+++ b/src/main/java/com/fanruan/api/runtime/PluginKit.java
@@ -0,0 +1,20 @@
+package com.fanruan.api.runtime;
+
+import com.fr.plugin.context.PluginContexts;
+
+/**
+ * @author richie
+ * @version 10.0
+ * Created by richie on 2019-08-30
+ * 插件相关的工具类
+ */
+public class PluginKit {
+
+    /**
+     * 当前插件是否可用(例如:插件授权文件过期时,该犯法会返回false)
+     * @return 插件可用则返回true,不可用则返回false
+     */
+    public static boolean isCurrentPluginAvailable() {
+        return PluginContexts.currentContext().isAvailable();
+    }
+}
diff --git a/src/test/java/com/fanruan/api/env/EnvKitTest.java b/src/test/java/com/fanruan/api/runtime/EnvKitTest.java
similarity index 97%
rename from src/test/java/com/fanruan/api/env/EnvKitTest.java
rename to src/test/java/com/fanruan/api/runtime/EnvKitTest.java
index 1894b28..20c20f0 100644
--- a/src/test/java/com/fanruan/api/env/EnvKitTest.java
+++ b/src/test/java/com/fanruan/api/runtime/EnvKitTest.java
@@ -1,4 +1,4 @@
-package com.fanruan.api.env;
+package com.fanruan.api.runtime;
 
 import com.fanruan.api.Prepare;
 import org.junit.Assert;