Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
seatunnel-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
宋勇
seatunnel-web
Commits
2a3cf766
提交
2a3cf766
authored
11月 24, 2023
作者:
宋勇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改 ftpclient 测试
上级
dd6bf62a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
4 行删除
+23
-4
FtpClientService.java
...che/seatunnel/datasource/plugin/ftp/FtpClientService.java
+1
-1
FtpDatasourceChannel.java
...seatunnel/datasource/plugin/ftp/FtpDatasourceChannel.java
+18
-2
OpcuaOptionRule.java
...he/seatunnel/datasource/plugin/opcua/OpcuaOptionRule.java
+4
-1
没有找到文件。
seatunnel-datasource/seatunnel-datasource-plugins/datasource-ftp/src/main/java/org/apache/seatunnel/datasource/plugin/ftp/FtpClientService.java
浏览文件 @
2a3cf766
...
@@ -21,7 +21,7 @@ public class FtpClientService {
...
@@ -21,7 +21,7 @@ public class FtpClientService {
public
static
final
String
FS_FTP_PASSWORD_PREFIX
=
"ftp."
;
public
static
final
String
FS_FTP_PASSWORD_PREFIX
=
"ftp."
;
public
static
final
String
E_SAME_DIRECTORY_ONLY
=
"/ftp"
;
public
static
final
String
E_SAME_DIRECTORY_ONLY
=
"/ftp"
;
p
rivate
FTPClient
connect
()
throws
IOException
{
p
ublic
static
FTPClient
connect
()
throws
IOException
{
FTPClient
client
=
null
;
FTPClient
client
=
null
;
String
host
=
FS_FTP_HOST
;
String
host
=
FS_FTP_HOST
;
int
port
=
FS_FTP_HOST_PORT
;
int
port
=
FS_FTP_HOST_PORT
;
...
...
seatunnel-datasource/seatunnel-datasource-plugins/datasource-ftp/src/main/java/org/apache/seatunnel/datasource/plugin/ftp/FtpDatasourceChannel.java
浏览文件 @
2a3cf766
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
package
org
.
apache
.
seatunnel
.
datasource
.
plugin
.
ftp
;
package
org
.
apache
.
seatunnel
.
datasource
.
plugin
.
ftp
;
import
lombok.NonNull
;
import
lombok.NonNull
;
import
org.apache.commons.net.ftp.FTPClient
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.fs.FileSystem
;
import
org.apache.hadoop.fs.FileSystem
;
import
org.apache.hadoop.fs.Path
;
import
org.apache.hadoop.fs.Path
;
...
@@ -46,11 +47,26 @@ public class FtpDatasourceChannel implements DataSourceChannel {
...
@@ -46,11 +47,26 @@ public class FtpDatasourceChannel implements DataSourceChannel {
public
boolean
checkDataSourceConnectivity
(
public
boolean
checkDataSourceConnectivity
(
@NonNull
String
pluginName
,
@NonNull
Map
<
String
,
String
>
requestParams
)
{
@NonNull
String
pluginName
,
@NonNull
Map
<
String
,
String
>
requestParams
)
{
FtpConfiguration
conf
=
FtpAConfiguration
.
getConfiguration
(
requestParams
);
FtpConfiguration
conf
=
FtpAConfiguration
.
getConfiguration
(
requestParams
);
if
(
Objects
.
isNull
(
conf
)){
try
{
FTPClient
ftpClient
=
FtpClientService
.
connect
();
if
(
Objects
.
isNull
(
conf
))
{
throw
new
DataSourcePluginException
(
String
.
format
(
"check ftp connectivity failed, config is: %s"
,
requestParams
));
}
if
(
ftpClient
.
changeWorkingDirectory
(
requestParams
.
get
(
FtpOptionRule
.
PATH
.
key
())))
{
return
true
;
}
else
{
throw
new
DataSourcePluginException
(
String
.
format
(
"check ftp connectivity failed, config is: %s"
,
requestParams
));
}
}
catch
(
Exception
e
)
{
throw
new
DataSourcePluginException
(
throw
new
DataSourcePluginException
(
String
.
format
(
"check ftp connectivity failed, config is: %s"
,
requestParams
));
String
.
format
(
"check ftp connectivity failed, config is: %s"
,
requestParams
));
}
}
return
true
;
//
return true;
}
}
@Override
@Override
...
...
seatunnel-datasource/seatunnel-datasource-plugins/datasource-opcua/src/main/java/org/apache/seatunnel/datasource/plugin/opcua/OpcuaOptionRule.java
浏览文件 @
2a3cf766
...
@@ -41,8 +41,11 @@ public class OpcuaOptionRule {
...
@@ -41,8 +41,11 @@ public class OpcuaOptionRule {
public
static
final
Option
<
String
>
TYPE
=
public
static
final
Option
<
String
>
TYPE
=
Options
.
key
(
"type"
).
stringType
().
defaultValue
(
"int"
).
withDescription
(
"type"
);
Options
.
key
(
"type"
).
stringType
().
defaultValue
(
"int"
).
withDescription
(
"type"
);
public
static
final
Option
<
Integer
>
GS
=
Options
.
key
(
"gs"
).
intType
().
defaultValue
(
1
).
withDescription
(
"type"
);
public
static
OptionRule
optionRule
()
{
public
static
OptionRule
optionRule
()
{
return
OptionRule
.
builder
().
required
(
HOST
,
PORT
,
SUFFIX
,
NS
,
ID
,
TYPE
).
build
();
return
OptionRule
.
builder
().
required
(
HOST
,
PORT
,
SUFFIX
,
NS
,
ID
,
TYPE
).
optional
(
GS
).
build
();
}
}
public
static
OptionRule
metadataRule
()
{
public
static
OptionRule
metadataRule
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论