Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
7d395f2d
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,发现更多精彩内容 >>
提交
7d395f2d
编写于
9月 29, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Registry refactoring
Former-commit-id:
78e6cf3d
上级
e5f3b644
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
42 deletion
+14
-42
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverLibraryDescriptor.java
...c/org/jkiss/dbeaver/registry/DriverLibraryDescriptor.java
+11
-42
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
...r.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
+3
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverLibraryDescriptor.java
浏览文件 @
7d395f2d
...
...
@@ -20,6 +20,7 @@ package org.jkiss.dbeaver.registry;
import
org.eclipse.core.runtime.FileLocator
;
import
org.eclipse.core.runtime.IConfigurationElement
;
import
org.eclipse.core.runtime.Platform
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
...
...
@@ -50,13 +51,12 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
public
static
final
String
FILE_SOURCE_MAVEN
=
"maven:/"
;
public
static
final
String
FILE_SOURCE_REPO
=
"repo:/"
;
public
static
final
String
FILE_SOURCE_PLATFORM
=
"platform:/"
;
public
static
final
String
FILE_SOURCE_LOCAL
=
"file:/"
;
//
public static final String FILE_SOURCE_LOCAL = "file:/";
private
final
DriverDescriptor
driver
;
private
final
FileType
type
;
private
final
OSDescriptor
system
;
private
String
path
;
private
String
fileExtension
;
private
String
description
;
private
boolean
custom
;
private
boolean
disabled
;
...
...
@@ -80,7 +80,6 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
osName
,
config
.
getAttribute
(
RegistryConstants
.
ATTR_ARCH
));
this
.
path
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_PATH
);
this
.
fileExtension
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_EXTENSION
);
this
.
description
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_DESCRIPTION
);
this
.
custom
=
false
;
}
...
...
@@ -90,12 +89,14 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
return
driver
;
}
@NotNull
@Override
public
FileType
getType
()
{
return
type
;
}
@NotNull
@Override
public
String
getPath
()
{
...
...
@@ -286,40 +287,6 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
return
null
;
}
/*
private String getMavenArtifactFileName() {
String artifactName = path.substring(FILE_SOURCE_MAVEN.length());
String ext = fileExtension;
String[] artifactNameParts = artifactName.split(":");
if (artifactNameParts.length != 3) {
log.warn("Bad Maven artifact reference: " + artifactName);
return artifactName.replace(':', '.');
}
String artifactFileName = DriverDescriptor.DRIVERS_FOLDER + "/" + artifactNameParts[1] + "/" +
artifactNameParts[0] + "." + artifactNameParts[1] + "." + artifactNameParts[2];
if (CommonUtils.isEmpty(ext)) {
switch (type) {
case lib:
return System.mapLibraryName(artifactFileName);
case executable:
if (RuntimeUtils.isPlatformWindows()) {
ext = "exe";
} else {
return artifactFileName;
}
break;
case jar:
ext = "jar";
break;
case license:
ext = "txt";
break;
}
}
return artifactFileName + '.' + ext;
}
*/
public
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
boolean
updateVersion
)
throws
IOException
,
InterruptedException
{
if
(
isMavenArtifact
())
{
...
...
@@ -409,11 +376,7 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
return
artifact
;
}
@Override
public
String
toString
()
{
return
getDisplayName
();
}
@NotNull
public
String
getDisplayName
()
{
if
(
isMavenArtifact
())
{
MavenArtifact
artifact
=
getMavenArtifact
();
...
...
@@ -427,4 +390,10 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
return
path
;
}
@Override
public
String
toString
()
{
return
getDisplayName
();
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
浏览文件 @
7d395f2d
...
...
@@ -40,6 +40,9 @@ public interface DBPDriverLibrary
license
}
@NotNull
String
getDisplayName
();
@NotNull
FileType
getType
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录