Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方
Blazer
提交
a61f747a
B
Blazer
项目概览
MaxKey单点登录官方
/
Blazer
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Blazer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a61f747a
编写于
4月 18, 2019
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pathutils
上级
22e4098e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
71 addition
and
11 deletion
+71
-11
blazer-trans/src/main/java/com/blazer/pipeline/PathUtils.java
...er-trans/src/main/java/com/blazer/pipeline/PathUtils.java
+69
-0
blazer-trans/src/main/java/com/blazer/pipeline/PathUtils.properties
...ns/src/main/java/com/blazer/pipeline/PathUtils.properties
+1
-0
blazer-trans/src/main/java/com/blazer/pipeline/PipeLineRunner.java
...ans/src/main/java/com/blazer/pipeline/PipeLineRunner.java
+1
-11
blazer-trans/src/main/java/com/blazer/pipeline/app.properties
...er-trans/src/main/java/com/blazer/pipeline/app.properties
+0
-0
未找到文件。
blazer-trans/src/main/java/com/blazer/pipeline/PathUtils.java
0 → 100644
浏览文件 @
a61f747a
package
com.blazer.pipeline
;
import
java.io.UnsupportedEncodingException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
PathUtils
{
private
final
Logger
_logger
=
LoggerFactory
.
getLogger
(
getClass
());
private
static
PathUtils
instance
=
null
;
private
String
classPath
;
private
String
appPath
;
public
static
String
WEB_INFO
=
"/WEB-INF/"
;
public
static
synchronized
PathUtils
getInstance
()
{
if
(
instance
==
null
)
{
instance
=
new
PathUtils
();
instance
.
_logger
.
debug
(
"getInstance()"
+
" new PathUtils instance"
);
}
return
instance
;
}
public
PathUtils
()
{
try
{
classPath
=
java
.
net
.
URLDecoder
.
decode
(
PathUtils
.
class
.
getResource
(
"PathUtils.properties"
).
getFile
(),
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
String
fileProtocol
=
PathUtils
.
class
.
getResource
(
"PathUtils.properties"
).
getProtocol
();
_logger
.
info
(
"Properties Protocol:"
+
PathUtils
.
class
.
getResource
(
"PathUtils.properties"
).
getProtocol
());
if
(
fileProtocol
.
equalsIgnoreCase
(
"file"
)&&
classPath
.
indexOf
(
"file:"
)==
0
){
classPath
=
classPath
.
substring
(
5
,
classPath
.
length
());
}
else
if
(
fileProtocol
.
equalsIgnoreCase
(
"jar"
)&&
classPath
.
indexOf
(
"file:"
)==
0
){
// file:/Server/webapps/app
classPath
=
classPath
.
substring
(
5
,
classPath
.
length
());
}
else
if
(
fileProtocol
.
equalsIgnoreCase
(
"wsjar"
)&&
classPath
.
indexOf
(
"file:"
)==
0
){
classPath
=
classPath
.
substring
(
5
,
classPath
.
length
());
}
else
if
(
classPath
.
equalsIgnoreCase
(
"file:"
)){
classPath
=
classPath
.
substring
(
5
,
classPath
.
length
());
}
classPath
=
classPath
.
substring
(
0
,
classPath
.
indexOf
((
"/"
+
PathUtils
.
class
.
getName
().
replaceAll
(
"\\."
,
"/"
)+
".properties"
)));
if
(
classPath
.
indexOf
(
WEB_INFO
)==-
1
)
{
appPath
=
classPath
.
substring
(
0
,
classPath
.
lastIndexOf
(
"/"
));
}
else
{
appPath
=
classPath
.
substring
(
0
,
classPath
.
lastIndexOf
(
WEB_INFO
));
}
System
.
setProperty
(
"APP_PATH"
,
appPath
);
System
.
setProperty
(
"CLASSES_PATH"
,
classPath
);
_logger
.
info
(
"PathUtils App Path : "
+
appPath
);
_logger
.
info
(
"PathUtils Class Path : "
+
classPath
);
}
public
String
getAppPath
(){
return
appPath
+
"/"
;
}
public
String
getClassPath
(){
return
classPath
+
"/"
;
}
public
String
getWebInf
(){
return
(
classPath
.
lastIndexOf
(
WEB_INFO
)>-
1
)?
(
appPath
+
WEB_INFO
)
:
""
;
}
}
blazer-trans/src/main/java/com/blazer/pipeline/PathUtils.properties
0 → 100644
浏览文件 @
a61f747a
v1.0.1
\ No newline at end of file
blazer-trans/src/main/java/com/blazer/pipeline/PipeLineRunner.java
浏览文件 @
a61f747a
...
...
@@ -26,6 +26,7 @@ public class PipeLineRunner {
public
static
void
main
(
String
[]
args
)
{
PipeLineRunner
runner
=
new
PipeLineRunner
();
try
{
PathUtils
.
getInstance
();
//List Environment Variables
runner
.
listEnvVars
();
new
JCommander
(
runner
.
runnerArgs
,
args
);
...
...
@@ -41,18 +42,7 @@ public class PipeLineRunner {
//Initialization ApplicationContext for Project
public
void
init
(
String
[]
args
){
String
path_str
=
PipeLineRunner
.
class
.
getResource
(
"app.properties"
).
getFile
().
toString
();
String
appClassPath
=
path_str
.
substring
(
0
,
path_str
.
indexOf
(
"com"
));
String
appPath
=
path_str
.
substring
(
path_str
.
startsWith
(
"/"
)?
1
:
0
,
path_str
.
indexOf
(
"/bin"
)
);
System
.
setProperty
(
"APP_CLASSPATH"
,
appClassPath
);
System
.
setProperty
(
"APP_PATH"
,
appPath
);
_logger
.
info
(
"Application Class Path "
+
System
.
getProperty
(
"APP_CLASSPATH"
));
_logger
.
info
(
"Application Path "
+
System
.
getProperty
(
"APP_PATH"
));
_logger
.
info
(
"user.dir "
+
System
.
getProperty
(
"user.dir"
));
if
(
runnerArgs
.
sqlWhere
!=
null
){
...
...
blazer-trans/src/main/java/com/blazer/pipeline/app.properties
已删除
100644 → 0
浏览文件 @
22e4098e
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录