diff --git a/core/src/main/java/com/alibaba/datax/core/util/container/PluginClassLoader.java b/core/src/main/java/com/alibaba/datax/core/util/container/PluginClassLoader.java deleted file mode 100644 index a45c2b83..00000000 --- a/core/src/main/java/com/alibaba/datax/core/util/container/PluginClassLoader.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.alibaba.datax.core.util.container; - - -/** - * @author fuyouj - * ClassLoader 抽象类的具体实现类,用于在运行时反射加载插件 - */ -public class PluginClassLoader extends ClassLoader{ -} diff --git a/core/src/main/java/com/alibaba/datax/core/util/container/PluginLoaderFactory.java b/core/src/main/java/com/alibaba/datax/core/util/container/PluginLoaderFactory.java deleted file mode 100644 index 9fdf49bb..00000000 --- a/core/src/main/java/com/alibaba/datax/core/util/container/PluginLoaderFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.alibaba.datax.core.util.container; - - -import com.alibaba.datax.common.constant.PluginType; -import com.alibaba.datax.common.exception.DataXException; -import com.alibaba.datax.common.util.Configuration; -import com.alibaba.datax.core.util.FrameworkErrorCode; -import org.apache.commons.lang3.StringUtils; - -/** - * PluginLoader简单工厂 - * @author fuyouj - */ -public class PluginLoaderFactory { - - private static final String JAR_LOADER = "jarLoader"; - private static final String PLUGIN_LOADER = "pluginLoader"; - - public static ClassLoader create(Configuration pluginDescConf, PluginType pluginType, String pluginName) { - - check(pluginDescConf, pluginType, pluginName); - - String loadType = pluginDescConf.getString("loadType"); - - if (JAR_LOADER.equalsIgnoreCase(loadType)) { - String path = pluginDescConf.getString("path"); - return new JarLoader(new String[]{path}); - } - - if (PLUGIN_LOADER.equalsIgnoreCase(loadType)){ - return new PluginClassLoader(); - } - throw DataXException.asDataXException( - FrameworkErrorCode.RUNTIME_ERROR, - String.format( - "%s插件[%s]无法加载,不支持的loadType,请检查程序代码", - pluginType, pluginName)); - } - - private static void check(Configuration pluginDescConf, PluginType pluginType, String pluginName) { - - String loadType = pluginDescConf.getString("loadType"); - if (StringUtils.isBlank(loadType)){ - throw DataXException.asDataXException( - FrameworkErrorCode.RUNTIME_ERROR, - String.format( - "%s插件[%s]无法加载,没有指定的loadType!", - pluginType, pluginName)); - } - - String pluginPath = pluginDescConf.getString("path"); - if (StringUtils.isBlank(pluginPath) && JAR_LOADER.equalsIgnoreCase(loadType)) { - throw DataXException.asDataXException( - FrameworkErrorCode.RUNTIME_ERROR, - String.format( - "%s插件[%s]路径非法!", - pluginType, pluginName)); - } - } -} diff --git a/datax-example/src/test/java/com/alibaba/datax/example/ExampleTestTemplate.java b/datax-example/src/test/java/com/alibaba/datax/example/ExampleTestTemplate.java deleted file mode 100644 index bd0f2a20..00000000 --- a/datax-example/src/test/java/com/alibaba/datax/example/ExampleTestTemplate.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.alibaba.datax.example; - -import org.junit.Before; - -import java.io.File; - -/** - * {@code Author} FuYouJ - * {@code Date} 2023/7/29 18:23 - */ - -public abstract class ExampleTestTemplate { - - @Before - public void fixWorkingDirectory(){ - String property = System.getProperty("user.dir"); - File file = new File(property); - File parentFile = file.getParentFile(); - System.setProperty("user.dir",parentFile.getAbsolutePath()); - } -}