Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
c16995d3
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c16995d3
编写于
10月 19, 2021
作者:
S
ShadelessFox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#12389 Add time components variables for native tools + data transfer
上级
c93f31a1
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
87 addition
and
55 deletion
+87
-55
plugins/org.jkiss.dbeaver.data.transfer.ui/src/org/jkiss/dbeaver/tools/transfer/ui/pages/stream/StreamConsumerPageOutput.java
...ls/transfer/ui/pages/stream/StreamConsumerPageOutput.java
+4
-13
plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/StreamTransferConsumer.java
...dbeaver/tools/transfer/stream/StreamTransferConsumer.java
+32
-10
plugins/org.jkiss.dbeaver.ext.mysql.ui/src/org/jkiss/dbeaver/ext/mysql/tools/MySQLExportWizardPageSettings.java
...beaver/ext/mysql/tools/MySQLExportWizardPageSettings.java
+3
-14
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/tasks/MySQLExportSettings.java
...rg/jkiss/dbeaver/ext/mysql/tasks/MySQLExportSettings.java
+1
-2
plugins/org.jkiss.dbeaver.ext.postgresql.ui/src/org/jkiss/dbeaver/ext/postgresql/tools/PostgreBackupWizardPageSettings.java
...ext/postgresql/tools/PostgreBackupWizardPageSettings.java
+3
-14
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/tasks/PostgreDatabaseBackupSettings.java
...r/ext/postgresql/tasks/PostgreDatabaseBackupSettings.java
+1
-2
plugins/org.jkiss.dbeaver.tasks.native/src/org/jkiss/dbeaver/tasks/nativetool/NativeToolUtils.java
...c/org/jkiss/dbeaver/tasks/nativetool/NativeToolUtils.java
+43
-0
未找到文件。
plugins/org.jkiss.dbeaver.data.transfer.ui/src/org/jkiss/dbeaver/tools/transfer/ui/pages/stream/StreamConsumerPageOutput.java
浏览文件 @
c16995d3
...
@@ -43,6 +43,7 @@ import org.jkiss.utils.CommonUtils;
...
@@ -43,6 +43,7 @@ import org.jkiss.utils.CommonUtils;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
import
java.util.List
;
import
java.util.List
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
public
class
StreamConsumerPageOutput
extends
DataTransferPageNodeSettings
{
public
class
StreamConsumerPageOutput
extends
DataTransferPageNodeSettings
{
...
@@ -340,19 +341,9 @@ public class StreamConsumerPageOutput extends DataTransferPageNodeSettings {
...
@@ -340,19 +341,9 @@ public class StreamConsumerPageOutput extends DataTransferPageNodeSettings {
@NotNull
@NotNull
private
String
[]
getAvailableVariables
()
{
private
String
[]
getAvailableVariables
()
{
final
Set
<
String
>
variables
=
new
LinkedHashSet
<>(
Arrays
.
asList
(
final
Set
<
String
>
variables
=
Arrays
.
stream
(
StreamTransferConsumer
.
VARIABLES
)
StreamTransferConsumer
.
VARIABLE_DATASOURCE
,
.
map
(
x
->
x
[
0
])
StreamTransferConsumer
.
VARIABLE_CATALOG
,
.
collect
(
Collectors
.
toCollection
(
LinkedHashSet:
:
new
));
StreamTransferConsumer
.
VARIABLE_SCHEMA
,
StreamTransferConsumer
.
VARIABLE_TABLE
,
StreamTransferConsumer
.
VARIABLE_TIMESTAMP
,
StreamTransferConsumer
.
VARIABLE_DATE
,
StreamTransferConsumer
.
VARIABLE_INDEX
,
StreamTransferConsumer
.
VARIABLE_PROJECT
,
StreamTransferConsumer
.
VARIABLE_CONN_TYPE
,
StreamTransferConsumer
.
VARIABLE_FILE
,
StreamTransferConsumer
.
VARIABLE_SCRIPT_FILE
));
final
List
<
DataTransferPipe
>
pipes
=
getWizard
().
getSettings
().
getDataPipes
();
final
List
<
DataTransferPipe
>
pipes
=
getWizard
().
getSettings
().
getDataPipes
();
if
(
pipes
.
size
()
==
1
)
{
if
(
pipes
.
size
()
==
1
)
{
...
...
plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/StreamTransferConsumer.java
浏览文件 @
c16995d3
...
@@ -85,18 +85,29 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
...
@@ -85,18 +85,29 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
public
static
final
String
VARIABLE_FILE
=
"file"
;
public
static
final
String
VARIABLE_FILE
=
"file"
;
public
static
final
String
VARIABLE_SCRIPT_FILE
=
"scriptFilename"
;
public
static
final
String
VARIABLE_SCRIPT_FILE
=
"scriptFilename"
;
public
static
final
String
VARIABLE_YEAR
=
"year"
;
public
static
final
String
VARIABLE_MONTH
=
"month"
;
public
static
final
String
VARIABLE_DAY
=
"day"
;
public
static
final
String
VARIABLE_HOUR
=
"hour"
;
public
static
final
String
VARIABLE_MINUTE
=
"minute"
;
public
static
final
String
[][]
VARIABLES
=
{
public
static
final
String
[][]
VARIABLES
=
{
{
VARIABLE_DATASOURCE
,
"source database datasource"
},
{
VARIABLE_DATASOURCE
,
"source database datasource"
},
{
VARIABLE_CATALOG
,
"source database catalog"
},
{
VARIABLE_CATALOG
,
"source database catalog"
},
{
VARIABLE_SCHEMA
,
"source database schema"
},
{
VARIABLE_SCHEMA
,
"source database schema"
},
{
VARIABLE_TABLE
,
"source database table"
},
{
VARIABLE_TABLE
,
"source database table"
},
{
VARIABLE_TIMESTAMP
,
"current timestamp"
},
{
VARIABLE_DATE
,
"current date"
},
{
VARIABLE_INDEX
,
"index of current file (if split is used)"
},
{
VARIABLE_INDEX
,
"index of current file (if split is used)"
},
{
VARIABLE_PROJECT
,
"source database project"
},
{
VARIABLE_PROJECT
,
"source database project"
},
{
VARIABLE_CONN_TYPE
,
"source database connection type"
},
{
VARIABLE_CONN_TYPE
,
"source database connection type"
},
{
VARIABLE_FILE
,
"output file path"
},
{
VARIABLE_FILE
,
"output file path"
},
{
VARIABLE_SCRIPT_FILE
,
"source script filename"
}
{
VARIABLE_SCRIPT_FILE
,
"source script filename"
},
{
VARIABLE_TIMESTAMP
,
"current timestamp"
},
{
VARIABLE_DATE
,
"current date"
},
{
VARIABLE_YEAR
,
"current year"
},
{
VARIABLE_MONTH
,
"current month"
},
{
VARIABLE_DAY
,
"current day"
},
{
VARIABLE_HOUR
,
"current hour"
},
{
VARIABLE_MINUTE
,
"current minute"
},
};
};
public
static
final
int
OUT_FILE_BUFFER_SIZE
=
100000
;
public
static
final
int
OUT_FILE_BUFFER_SIZE
=
100000
;
...
@@ -520,6 +531,14 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
...
@@ -520,6 +531,14 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
}
}
private
String
translatePattern
(
String
pattern
,
final
File
targetFile
)
{
private
String
translatePattern
(
String
pattern
,
final
File
targetFile
)
{
final
Date
ts
;
if
(
parameters
.
startTimestamp
!=
null
)
{
// Use saved timestamp (#7352)
ts
=
parameters
.
startTimestamp
;
}
else
{
ts
=
new
Date
();
}
return
GeneralUtils
.
replaceVariables
(
pattern
,
name
->
{
return
GeneralUtils
.
replaceVariables
(
pattern
,
name
->
{
switch
(
name
)
{
switch
(
name
)
{
case
VARIABLE_DATASOURCE:
{
case
VARIABLE_DATASOURCE:
{
...
@@ -558,13 +577,6 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
...
@@ -558,13 +577,6 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
return
stripObjectName
(
tableName
);
return
stripObjectName
(
tableName
);
}
}
case
VARIABLE_TIMESTAMP:
case
VARIABLE_TIMESTAMP:
Date
ts
;
if
(
parameters
.
startTimestamp
!=
null
)
{
// Use saved timestamp (#7352)
ts
=
parameters
.
startTimestamp
;
}
else
{
ts
=
new
Date
();
}
try
{
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
settings
.
getOutputTimestampPattern
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
settings
.
getOutputTimestampPattern
());
return
sdf
.
format
(
ts
);
return
sdf
.
format
(
ts
);
...
@@ -574,6 +586,16 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
...
@@ -574,6 +586,16 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
}
}
case
VARIABLE_DATE:
case
VARIABLE_DATE:
return
RuntimeUtils
.
getCurrentDate
();
return
RuntimeUtils
.
getCurrentDate
();
case
VARIABLE_YEAR:
return
new
SimpleDateFormat
(
"yyyy"
).
format
(
ts
);
case
VARIABLE_MONTH:
return
new
SimpleDateFormat
(
"MM"
).
format
(
ts
);
case
VARIABLE_DAY:
return
new
SimpleDateFormat
(
"dd"
).
format
(
ts
);
case
VARIABLE_HOUR:
return
new
SimpleDateFormat
(
"HH"
).
format
(
ts
);
case
VARIABLE_MINUTE:
return
new
SimpleDateFormat
(
"mm"
).
format
(
ts
);
case
VARIABLE_INDEX:
case
VARIABLE_INDEX:
return
String
.
valueOf
(
parameters
.
orderNumber
+
1
);
return
String
.
valueOf
(
parameters
.
orderNumber
+
1
);
case
VARIABLE_PROJECT:
{
case
VARIABLE_PROJECT:
{
...
...
plugins/org.jkiss.dbeaver.ext.mysql.ui/src/org/jkiss/dbeaver/ext/mysql/tools/MySQLExportWizardPageSettings.java
浏览文件 @
c16995d3
...
@@ -34,6 +34,7 @@ import org.jkiss.dbeaver.utils.GeneralUtils;
...
@@ -34,6 +34,7 @@ import org.jkiss.dbeaver.utils.GeneralUtils;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.CommonUtils
;
import
java.io.File
;
import
java.io.File
;
import
java.util.Arrays
;
class
MySQLExportWizardPageSettings
extends
MySQLWizardPageSettings
<
MySQLExportWizard
>
{
class
MySQLExportWizardPageSettings
extends
MySQLWizardPageSettings
<
MySQLExportWizard
>
{
...
@@ -111,23 +112,11 @@ class MySQLExportWizardPageSettings extends MySQLWizardPageSettings<MySQLExportW
...
@@ -111,23 +112,11 @@ class MySQLExportWizardPageSettings extends MySQLWizardPageSettings<MySQLExportW
Group
outputGroup
=
UIUtils
.
createControlGroup
(
composite
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_group_output
,
2
,
GridData
.
FILL_HORIZONTAL
,
0
);
Group
outputGroup
=
UIUtils
.
createControlGroup
(
composite
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_group_output
,
2
,
GridData
.
FILL_HORIZONTAL
,
0
);
outputFolderText
=
DialogUtils
.
createOutputFolderChooser
(
outputGroup
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_label_out_text
,
e
->
updateState
());
outputFolderText
=
DialogUtils
.
createOutputFolderChooser
(
outputGroup
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_label_out_text
,
e
->
updateState
());
outputFileText
=
UIUtils
.
createLabelText
(
outputGroup
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_label_file_name_pattern_text
,
wizard
.
getSettings
().
getOutputFilePattern
());
outputFileText
=
UIUtils
.
createLabelText
(
outputGroup
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_label_file_name_pattern_text
,
wizard
.
getSettings
().
getOutputFilePattern
());
UIUtils
.
setContentProposalToolTip
(
outputFileText
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_label_file_name_pattern_tip
,
UIUtils
.
setContentProposalToolTip
(
outputFileText
,
MySQLUIMessages
.
tools_db_export_wizard_page_settings_label_file_name_pattern_tip
,
NativeToolUtils
.
ALL_VARIABLES
);
NativeToolUtils
.
VARIABLE_HOST
,
NativeToolUtils
.
VARIABLE_DATABASE
,
NativeToolUtils
.
VARIABLE_TABLE
,
NativeToolUtils
.
VARIABLE_DATE
,
NativeToolUtils
.
VARIABLE_TIMESTAMP
,
NativeToolUtils
.
VARIABLE_CONN_TYPE
);
ContentAssistUtils
.
installContentProposal
(
ContentAssistUtils
.
installContentProposal
(
outputFileText
,
outputFileText
,
new
SmartTextContentAdapter
(),
new
SmartTextContentAdapter
(),
new
StringContentProposalProvider
(
new
StringContentProposalProvider
(
Arrays
.
stream
(
NativeToolUtils
.
ALL_VARIABLES
).
map
(
GeneralUtils:
:
variablePattern
).
toArray
(
String
[]::
new
)));
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_HOST
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_DATABASE
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_TABLE
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_DATE
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_TIMESTAMP
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_CONN_TYPE
)));
createExtraArgsInput
(
outputGroup
);
createExtraArgsInput
(
outputGroup
);
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/tasks/MySQLExportSettings.java
浏览文件 @
c16995d3
...
@@ -330,9 +330,8 @@ public class MySQLExportSettings extends AbstractImportExportSettings<DBSObject>
...
@@ -330,9 +330,8 @@ public class MySQLExportSettings extends AbstractImportExportSettings<DBSObject>
case
NativeToolUtils
.
VARIABLE_DATE
:
case
NativeToolUtils
.
VARIABLE_DATE
:
return
RuntimeUtils
.
getCurrentDate
();
return
RuntimeUtils
.
getCurrentDate
();
default
:
default
:
System
.
getProperty
(
name
);
return
NativeToolUtils
.
replaceVariables
(
name
);
}
}
return
null
;
});
});
return
new
File
(
getOutputFolder
(),
outFileName
);
return
new
File
(
getOutputFolder
(),
outFileName
);
}
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.ui/src/org/jkiss/dbeaver/ext/postgresql/tools/PostgreBackupWizardPageSettings.java
浏览文件 @
c16995d3
...
@@ -35,6 +35,7 @@ import org.jkiss.dbeaver.utils.GeneralUtils;
...
@@ -35,6 +35,7 @@ import org.jkiss.dbeaver.utils.GeneralUtils;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.CommonUtils
;
import
java.io.File
;
import
java.io.File
;
import
java.util.Arrays
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -146,23 +147,11 @@ class PostgreBackupWizardPageSettings extends PostgreToolWizardPageSettings<Post
...
@@ -146,23 +147,11 @@ class PostgreBackupWizardPageSettings extends PostgreToolWizardPageSettings<Post
outputGroup
,
outputGroup
,
PostgreMessages
.
wizard_backup_page_setting_label_file_name_pattern
,
PostgreMessages
.
wizard_backup_page_setting_label_file_name_pattern
,
wizard
.
getSettings
().
getOutputFilePattern
());
wizard
.
getSettings
().
getOutputFilePattern
());
UIUtils
.
setContentProposalToolTip
(
outputFileText
,
PostgreMessages
.
wizard_backup_page_setting_label_file_name_pattern_output
,
UIUtils
.
setContentProposalToolTip
(
outputFileText
,
PostgreMessages
.
wizard_backup_page_setting_label_file_name_pattern_output
,
NativeToolUtils
.
ALL_VARIABLES
);
NativeToolUtils
.
VARIABLE_HOST
,
NativeToolUtils
.
VARIABLE_DATABASE
,
NativeToolUtils
.
VARIABLE_TABLE
,
NativeToolUtils
.
VARIABLE_DATE
,
NativeToolUtils
.
VARIABLE_TIMESTAMP
,
NativeToolUtils
.
VARIABLE_CONN_TYPE
);
ContentAssistUtils
.
installContentProposal
(
ContentAssistUtils
.
installContentProposal
(
outputFileText
,
outputFileText
,
new
SmartTextContentAdapter
(),
new
SmartTextContentAdapter
(),
new
StringContentProposalProvider
(
new
StringContentProposalProvider
(
Arrays
.
stream
(
NativeToolUtils
.
ALL_VARIABLES
).
map
(
GeneralUtils:
:
variablePattern
).
toArray
(
String
[]::
new
)));
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_HOST
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_DATABASE
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_TABLE
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_DATE
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_TIMESTAMP
),
GeneralUtils
.
variablePattern
(
NativeToolUtils
.
VARIABLE_CONN_TYPE
)));
outputFileText
.
addModifyListener
(
e
->
wizard
.
getSettings
().
setOutputFilePattern
(
outputFileText
.
getText
()));
outputFileText
.
addModifyListener
(
e
->
wizard
.
getSettings
().
setOutputFilePattern
(
outputFileText
.
getText
()));
fixOutputFileExtension
();
fixOutputFileExtension
();
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/tasks/PostgreDatabaseBackupSettings.java
浏览文件 @
c16995d3
...
@@ -287,9 +287,8 @@ public class PostgreDatabaseBackupSettings extends PostgreBackupRestoreSettings
...
@@ -287,9 +287,8 @@ public class PostgreDatabaseBackupSettings extends PostgreBackupRestoreSettings
case
NativeToolUtils
.
VARIABLE_DATE
:
case
NativeToolUtils
.
VARIABLE_DATE
:
return
RuntimeUtils
.
getCurrentDate
();
return
RuntimeUtils
.
getCurrentDate
();
default
:
default
:
System
.
getProperty
(
name
);
return
NativeToolUtils
.
replaceVariables
(
name
);
}
}
return
null
;
});
});
return
new
File
(
getOutputFolder
(),
outputFileName
);
return
new
File
(
getOutputFolder
(),
outputFileName
);
}
}
...
...
plugins/org.jkiss.dbeaver.tasks.native/src/org/jkiss/dbeaver/tasks/nativetool/NativeToolUtils.java
浏览文件 @
c16995d3
...
@@ -16,8 +16,13 @@
...
@@ -16,8 +16,13 @@
*/
*/
package
org.jkiss.dbeaver.tasks.nativetool
;
package
org.jkiss.dbeaver.tasks.nativetool
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.utils.RuntimeUtils
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.CommonUtils
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
abstract
class
NativeToolUtils
{
public
abstract
class
NativeToolUtils
{
public
static
final
String
VARIABLE_HOST
=
"host"
;
public
static
final
String
VARIABLE_HOST
=
"host"
;
...
@@ -25,8 +30,27 @@ public abstract class NativeToolUtils {
...
@@ -25,8 +30,27 @@ public abstract class NativeToolUtils {
public
static
final
String
VARIABLE_TABLE
=
"table"
;
public
static
final
String
VARIABLE_TABLE
=
"table"
;
public
static
final
String
VARIABLE_DATE
=
"date"
;
public
static
final
String
VARIABLE_DATE
=
"date"
;
public
static
final
String
VARIABLE_TIMESTAMP
=
"timestamp"
;
public
static
final
String
VARIABLE_TIMESTAMP
=
"timestamp"
;
public
static
final
String
VARIABLE_YEAR
=
"year"
;
public
static
final
String
VARIABLE_MONTH
=
"month"
;
public
static
final
String
VARIABLE_DAY
=
"day"
;
public
static
final
String
VARIABLE_HOUR
=
"hour"
;
public
static
final
String
VARIABLE_MINUTE
=
"minute"
;
public
static
final
String
VARIABLE_CONN_TYPE
=
"connectionType"
;
public
static
final
String
VARIABLE_CONN_TYPE
=
"connectionType"
;
public
static
final
String
[]
ALL_VARIABLES
=
{
VARIABLE_HOST
,
VARIABLE_DATABASE
,
VARIABLE_TABLE
,
VARIABLE_DATE
,
VARIABLE_TIMESTAMP
,
VARIABLE_YEAR
,
VARIABLE_MONTH
,
VARIABLE_DAY
,
VARIABLE_HOUR
,
VARIABLE_MINUTE
,
VARIABLE_CONN_TYPE
};
public
static
boolean
isSecureString
(
AbstractNativeToolSettings
settings
,
String
string
)
{
public
static
boolean
isSecureString
(
AbstractNativeToolSettings
settings
,
String
string
)
{
String
userPassword
=
settings
.
getDataSourceContainer
().
getActualConnectionConfiguration
().
getUserPassword
();
String
userPassword
=
settings
.
getDataSourceContainer
().
getActualConnectionConfiguration
().
getUserPassword
();
String
toolUserPassword
=
settings
.
getToolUserPassword
();
String
toolUserPassword
=
settings
.
getToolUserPassword
();
...
@@ -34,4 +58,23 @@ public abstract class NativeToolUtils {
...
@@ -34,4 +58,23 @@ public abstract class NativeToolUtils {
!
CommonUtils
.
isEmpty
(
userPassword
)
&&
string
.
endsWith
(
userPassword
);
!
CommonUtils
.
isEmpty
(
userPassword
)
&&
string
.
endsWith
(
userPassword
);
}
}
@NotNull
public
static
String
replaceVariables
(
@NotNull
String
name
)
{
switch
(
name
)
{
case
NativeToolUtils
.
VARIABLE_DATE
:
return
RuntimeUtils
.
getCurrentDate
();
case
NativeToolUtils
.
VARIABLE_YEAR
:
return
new
SimpleDateFormat
(
"yyyy"
).
format
(
new
Date
());
case
NativeToolUtils
.
VARIABLE_MONTH
:
return
new
SimpleDateFormat
(
"MM"
).
format
(
new
Date
());
case
NativeToolUtils
.
VARIABLE_DAY
:
return
new
SimpleDateFormat
(
"dd"
).
format
(
new
Date
());
case
NativeToolUtils
.
VARIABLE_HOUR
:
return
new
SimpleDateFormat
(
"HH"
).
format
(
new
Date
());
case
NativeToolUtils
.
VARIABLE_MINUTE
:
return
new
SimpleDateFormat
(
"mm"
).
format
(
new
Date
());
default
:
return
System
.
getProperty
(
name
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录