Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
00eac0b4
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,发现更多精彩内容 >>
提交
00eac0b4
编写于
9月 19, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Maven artifacts update
Former-commit-id:
803043a8
上级
eeb26894
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
9 deletion
+43
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverDescriptor.java
...core/src/org/jkiss/dbeaver/registry/DriverDescriptor.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverFileDescriptor.java
.../src/org/jkiss/dbeaver/registry/DriverFileDescriptor.java
+14
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRegistry.java
...e/src/org/jkiss/dbeaver/registry/maven/MavenRegistry.java
+12
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
...src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
+10
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
...iss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
...jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
+4
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
...org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
+1
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverDescriptor.java
浏览文件 @
00eac0b4
...
@@ -956,7 +956,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
...
@@ -956,7 +956,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
{
try
{
try
{
file
.
downloadLibraryFile
(
monitor
);
file
.
downloadLibraryFile
(
monitor
,
false
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
log
.
warn
(
"Can't obtain driver license"
,
e
);
log
.
warn
(
"Can't obtain driver license"
,
e
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverFileDescriptor.java
浏览文件 @
00eac0b4
...
@@ -323,10 +323,10 @@ public class DriverFileDescriptor implements DBPDriverFile
...
@@ -323,10 +323,10 @@ public class DriverFileDescriptor implements DBPDriverFile
}
}
*/
*/
public
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
)
throws
IOException
,
InterruptedException
public
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
boolean
updateVersion
)
throws
IOException
,
InterruptedException
{
{
if
(
isMavenArtifact
())
{
if
(
isMavenArtifact
())
{
downloadMavenArtifact
(
monitor
);
downloadMavenArtifact
(
monitor
,
updateVersion
);
}
}
String
externalURL
=
getExternalURL
();
String
externalURL
=
getExternalURL
();
if
(
externalURL
==
null
)
{
if
(
externalURL
==
null
)
{
...
@@ -386,16 +386,23 @@ public class DriverFileDescriptor implements DBPDriverFile
...
@@ -386,16 +386,23 @@ public class DriverFileDescriptor implements DBPDriverFile
monitor
.
done
();
monitor
.
done
();
}
}
private
void
downloadMavenArtifact
(
DBRProgressMonitor
monitor
)
throws
IOException
{
private
void
downloadMavenArtifact
(
DBRProgressMonitor
monitor
,
boolean
updateVersion
)
throws
IOException
{
MavenArtifactReference
artifactInfo
=
new
MavenArtifactReference
(
path
);
MavenArtifactReference
artifactInfo
=
new
MavenArtifactReference
(
path
);
if
(
updateVersion
)
{
MavenRegistry
.
getInstance
().
resetArtifactInfo
(
artifactInfo
);
}
MavenArtifact
artifact
=
MavenRegistry
.
getInstance
().
findArtifact
(
artifactInfo
);
MavenArtifact
artifact
=
MavenRegistry
.
getInstance
().
findArtifact
(
artifactInfo
);
if
(
artifact
==
null
)
{
if
(
artifact
==
null
)
{
throw
new
IOException
(
"Maven artifact '"
+
path
+
"' not found"
);
throw
new
IOException
(
"Maven artifact '"
+
path
+
"' not found"
);
}
}
MavenLocalVersion
localVersion
=
artifact
.
getActiveLocalVersion
();
if
(
updateVersion
)
{
if
(
localVersion
!=
null
&&
localVersion
.
getCacheFile
().
exists
())
{
artifact
.
loadMetadata
();
// Already cached
}
else
{
return
;
MavenLocalVersion
localVersion
=
artifact
.
getActiveLocalVersion
();
if
(
localVersion
!=
null
&&
localVersion
.
getCacheFile
().
exists
())
{
// Already cached
return
;
}
}
}
artifact
.
resolveVersion
(
monitor
,
artifactInfo
.
getVersion
());
artifact
.
resolveVersion
(
monitor
,
artifactInfo
.
getVersion
());
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRegistry.java
浏览文件 @
00eac0b4
...
@@ -131,6 +131,17 @@ public class MavenRegistry
...
@@ -131,6 +131,17 @@ public class MavenRegistry
return
null
;
return
null
;
}
}
public
void
resetArtifactInfo
(
MavenArtifactReference
artifactReference
)
{
String
groupId
=
artifactReference
.
getGroupId
();
String
artifactId
=
artifactReference
.
getArtifactId
();
String
fullId
=
groupId
+
":"
+
artifactId
;
notFoundArtifacts
.
remove
(
fullId
);
for
(
MavenRepository
repository
:
repositories
)
{
repository
.
resetArtifactCache
(
groupId
,
artifactId
);
}
localRepository
.
resetArtifactCache
(
groupId
,
artifactId
);
}
@Nullable
@Nullable
private
MavenArtifact
findInRepositories
(
@NotNull
String
groupId
,
@NotNull
String
artifactId
,
boolean
resolve
)
{
private
MavenArtifact
findInRepositories
(
@NotNull
String
groupId
,
@NotNull
String
artifactId
,
boolean
resolve
)
{
// Try all available repositories (without resolve)
// Try all available repositories (without resolve)
...
@@ -155,4 +166,5 @@ public class MavenRegistry
...
@@ -155,4 +166,5 @@ public class MavenRegistry
}
}
return
null
;
return
null
;
}
}
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
浏览文件 @
00eac0b4
...
@@ -34,6 +34,7 @@ import org.xml.sax.Attributes;
...
@@ -34,6 +34,7 @@ import org.xml.sax.Attributes;
import
java.io.*
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -133,6 +134,15 @@ public class MavenRepository
...
@@ -133,6 +134,15 @@ public class MavenRepository
return
null
;
return
null
;
}
}
void
resetArtifactCache
(
@NotNull
String
groupId
,
@NotNull
String
artifactId
)
{
for
(
Iterator
<
MavenArtifact
>
iterator
=
cachedArtifacts
.
iterator
();
iterator
.
hasNext
();
)
{
MavenArtifact
artifact
=
iterator
.
next
();
if
(
artifact
.
getGroupId
().
equals
(
groupId
)
&&
artifact
.
getArtifactId
().
equals
(
artifactId
))
{
iterator
.
remove
();
}
}
}
private
synchronized
void
addCachedArtifact
(
@NotNull
MavenArtifact
artifact
)
{
private
synchronized
void
addCachedArtifact
(
@NotNull
MavenArtifact
artifact
)
{
cachedArtifacts
.
add
(
artifact
);
cachedArtifacts
.
add
(
artifact
);
// saveCache();
// saveCache();
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
浏览文件 @
00eac0b4
...
@@ -127,7 +127,7 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
...
@@ -127,7 +127,7 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
@Override
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
try
{
try
{
file
.
downloadLibraryFile
(
monitor
);
file
.
downloadLibraryFile
(
monitor
,
getWizard
().
isUpdateVersion
()
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
InvocationTargetException
(
e
);
throw
new
InvocationTargetException
(
e
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
浏览文件 @
00eac0b4
...
@@ -62,6 +62,10 @@ public class DriverDownloadWizard extends Wizard implements IExportWizard {
...
@@ -62,6 +62,10 @@ public class DriverDownloadWizard extends Wizard implements IExportWizard {
return
forceDownload
;
return
forceDownload
;
}
}
public
boolean
isUpdateVersion
()
{
return
updateVersion
;
}
private
void
loadSettings
()
private
void
loadSettings
()
{
{
IDialogSettings
section
=
UIUtils
.
getDialogSettings
(
DRIVER_DOWNLOAD_DIALOG_SETTINGS
);
IDialogSettings
section
=
UIUtils
.
getDialogSettings
(
DRIVER_DOWNLOAD_DIALOG_SETTINGS
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
浏览文件 @
00eac0b4
...
@@ -480,6 +480,7 @@ public class DriverEditDialog extends HelpEnabledDialog
...
@@ -480,6 +480,7 @@ public class DriverEditDialog extends HelpEnabledDialog
@Override
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
public
void
widgetSelected
(
SelectionEvent
e
)
{
DriverDownloadDialog
.
updateDriverFiles
(
getShell
(),
driver
,
libList
,
true
);
DriverDownloadDialog
.
updateDriverFiles
(
getShell
(),
driver
,
libList
,
true
);
changeLibContent
();
}
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录