Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
5a64c29e
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,发现更多精彩内容 >>
提交
5a64c29e
编写于
10月 15, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Get rid of driver context
上级
b624899c
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
94 addition
and
199 deletion
+94
-199
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverDependencies.java
...org/jkiss/dbeaver/registry/driver/DriverDependencies.java
+7
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryAbstract.java
.../jkiss/dbeaver/registry/driver/DriverLibraryAbstract.java
+7
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryLocal.java
...org/jkiss/dbeaver/registry/driver/DriverLibraryLocal.java
+4
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenArtifact.java
...s/dbeaver/registry/driver/DriverLibraryMavenArtifact.java
+18
-18
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenDependency.java
...dbeaver/registry/driver/DriverLibraryMavenDependency.java
+3
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryRepository.java
...kiss/dbeaver/registry/driver/DriverLibraryRepository.java
+2
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifact.java
...e/src/org/jkiss/dbeaver/registry/maven/MavenArtifact.java
+10
-18
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
...rg/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
+20
-20
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRegistry.java
...e/src/org/jkiss/dbeaver/registry/maven/MavenRegistry.java
+8
-8
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
...src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
+4
-21
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
...iss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
+4
-6
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPDriverContext.java
.../org/jkiss/dbeaver/model/connection/DBPDriverContext.java
+0
-78
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPDriverDependencies.java
...jkiss/dbeaver/model/connection/DBPDriverDependencies.java
+2
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPDriverLibrary.java
.../org/jkiss/dbeaver/model/connection/DBPDriverLibrary.java
+5
-4
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverDependencies.java
浏览文件 @
5a64c29e
...
...
@@ -20,7 +20,7 @@ package org.jkiss.dbeaver.registry.driver;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.connection.DBPDriverDependencies
;
import
org.jkiss.dbeaver.model.connection.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
import
java.io.IOException
;
import
java.util.*
;
...
...
@@ -39,7 +39,7 @@ public class DriverDependencies implements DBPDriverDependencies
}
@Override
public
void
resolveDependencies
(
DB
PDriverContext
context
)
throws
DBException
{
public
void
resolveDependencies
(
DB
RProgressMonitor
monitor
)
throws
DBException
{
try
{
{
rootNodes
.
clear
();
...
...
@@ -49,7 +49,7 @@ public class DriverDependencies implements DBPDriverDependencies
DependencyNode
node
=
new
DependencyNode
(
null
,
library
);
libMap
.
put
(
node
.
library
.
getId
(),
node
.
library
);
resolveDependencies
(
context
,
node
,
libMap
);
resolveDependencies
(
monitor
,
node
,
libMap
);
rootNodes
.
add
(
node
);
}
libraryList
.
clear
();
...
...
@@ -70,12 +70,10 @@ public class DriverDependencies implements DBPDriverDependencies
}
System.out.println(sb.toString());
*/
/*
System
.
out
.
println
(
"---------------------------"
);
for
(
DependencyNode
node
:
rootNodes
)
{
dumpNode
(
node
,
0
);
}
*/
}
}
catch
(
IOException
e
)
{
throw
new
DBException
(
"IO error while resolving dependencies"
,
e
);
...
...
@@ -93,9 +91,9 @@ public class DriverDependencies implements DBPDriverDependencies
}
}
private
void
resolveDependencies
(
DB
PDriverContext
context
,
DependencyNode
ownerNode
,
Map
<
String
,
DBPDriverLibrary
>
libMap
)
throws
IOException
{
ownerNode
.
library
.
resolve
(
context
);
Collection
<?
extends
DBPDriverLibrary
>
dependencies
=
ownerNode
.
library
.
getDependencies
(
context
);
private
void
resolveDependencies
(
DB
RProgressMonitor
monitor
,
DependencyNode
ownerNode
,
Map
<
String
,
DBPDriverLibrary
>
libMap
)
throws
IOException
{
ownerNode
.
library
.
resolve
(
monitor
);
Collection
<?
extends
DBPDriverLibrary
>
dependencies
=
ownerNode
.
library
.
getDependencies
(
monitor
);
if
(
dependencies
!=
null
&&
!
dependencies
.
isEmpty
())
{
for
(
DBPDriverLibrary
dep
:
dependencies
)
{
DependencyNode
node
=
new
DependencyNode
(
ownerNode
,
dep
);
...
...
@@ -108,7 +106,7 @@ public class DriverDependencies implements DBPDriverDependencies
}
for
(
DependencyNode
node
:
ownerNode
.
dependencies
)
{
if
(!
node
.
duplicate
)
{
resolveDependencies
(
context
,
node
,
libMap
);
resolveDependencies
(
monitor
,
node
,
libMap
);
}
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryAbstract.java
浏览文件 @
5a64c29e
...
...
@@ -21,8 +21,8 @@ import org.eclipse.core.runtime.IConfigurationElement;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.model.connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.connection.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.OSDescriptor
;
import
org.jkiss.dbeaver.registry.RegistryConstants
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
...
...
@@ -151,7 +151,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
return
system
==
null
||
system
.
matches
(
DBeaverCore
.
getInstance
().
getLocalSystem
());
}
public
void
downloadLibraryFile
(
@NotNull
DB
PDriverContext
context
,
boolean
forceUpdate
,
String
taskName
)
throws
IOException
,
InterruptedException
public
void
downloadLibraryFile
(
@NotNull
DB
RProgressMonitor
monitor
,
boolean
forceUpdate
,
String
taskName
)
throws
IOException
,
InterruptedException
{
final
File
localFile
=
getLocalFile
();
if
(
localFile
==
null
)
{
...
...
@@ -167,7 +167,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
}
}
String
externalURL
=
getExternalURL
(
context
);
String
externalURL
=
getExternalURL
(
monitor
);
if
(
externalURL
==
null
)
{
throw
new
IOException
(
"Unresolved file reference: "
+
getPath
());
}
...
...
@@ -185,7 +185,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
if
(
bufferLength
<
50000
)
{
bufferLength
=
50000
;
}
context
.
getMonitor
()
.
beginTask
(
taskName
+
" - "
+
externalURL
,
contentLength
);
monitor
.
beginTask
(
taskName
+
" - "
+
externalURL
,
contentLength
);
boolean
success
=
false
;
try
(
final
OutputStream
outputStream
=
new
FileOutputStream
(
localFile
))
{
try
(
final
InputStream
inputStream
=
connection
.
getInputStream
())
{
...
...
@@ -193,7 +193,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
byte
[]
buffer
=
new
byte
[
bufferLength
];
int
totalRead
=
0
;
for
(;;)
{
if
(
context
.
getMonitor
()
.
isCanceled
())
{
if
(
monitor
.
isCanceled
())
{
throw
new
InterruptedException
();
}
//monitor.subTask(numberFormat.format(totalRead) + "/" + numberFormat.format(contentLength));
...
...
@@ -203,7 +203,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
break
;
}
outputStream
.
write
(
buffer
,
0
,
count
);
context
.
getMonitor
()
.
worked
(
count
);
monitor
.
worked
(
count
);
totalRead
+=
count
;
}
}
...
...
@@ -213,7 +213,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
log
.
warn
(
"Can't delete local driver file '"
+
localFile
.
getAbsolutePath
()
+
"'"
);
}
}
context
.
getMonitor
()
.
done
();
monitor
.
done
();
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryLocal.java
浏览文件 @
5a64c29e
...
...
@@ -23,8 +23,8 @@ import org.eclipse.core.runtime.Platform;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.connection.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.ui.UIIcon
;
import
java.io.File
;
...
...
@@ -58,7 +58,7 @@ public class DriverLibraryLocal extends DriverLibraryAbstract
}
@Override
public
void
resolve
(
DB
PDriverContext
context
)
throws
IOException
{
public
void
resolve
(
DB
RProgressMonitor
monitor
)
throws
IOException
{
// do nothing
}
...
...
@@ -68,7 +68,7 @@ public class DriverLibraryLocal extends DriverLibraryAbstract
@Nullable
@Override
public
String
getExternalURL
(
DB
PDriverContext
context
)
{
public
String
getExternalURL
(
DB
RProgressMonitor
monitor
)
{
return
null
;
}
...
...
@@ -115,7 +115,7 @@ public class DriverLibraryLocal extends DriverLibraryAbstract
@Nullable
@Override
public
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DB
PDriverContext
context
)
throws
IOException
{
public
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DB
RProgressMonitor
monitor
)
throws
IOException
{
return
null
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenArtifact.java
浏览文件 @
5a64c29e
...
...
@@ -22,8 +22,8 @@ import org.jkiss.code.NotNull;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.connection.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.maven.*
;
import
org.jkiss.dbeaver.ui.UIIcon
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -74,24 +74,24 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
}
@Override
public
void
resolve
(
DB
PDriverContext
context
)
throws
IOException
{
if
(
getArtifactVersion
(
context
)
==
null
)
{
public
void
resolve
(
DB
RProgressMonitor
monitor
)
throws
IOException
{
if
(
getArtifactVersion
(
monitor
)
==
null
)
{
throw
new
IOException
(
"Can't resolve artifact "
+
this
+
" version"
);
}
}
@Nullable
protected
MavenArtifactVersion
getArtifactVersion
(
DB
PDriverContext
context
)
{
protected
MavenArtifactVersion
getArtifactVersion
(
DB
RProgressMonitor
monitor
)
{
if
(
localVersion
==
null
)
{
localVersion
=
MavenRegistry
.
getInstance
().
findArtifact
(
context
,
null
,
reference
);
localVersion
=
MavenRegistry
.
getInstance
().
findArtifact
(
monitor
,
null
,
reference
);
}
return
localVersion
;
}
@Nullable
@Override
public
String
getExternalURL
(
DB
PDriverContext
context
)
{
MavenArtifactVersion
localVersion
=
getArtifactVersion
(
context
);
public
String
getExternalURL
(
DB
RProgressMonitor
monitor
)
{
MavenArtifactVersion
localVersion
=
getArtifactVersion
(
monitor
);
if
(
localVersion
!=
null
)
{
return
localVersion
.
getExternalURL
(
MavenArtifact
.
FILE_JAR
);
}
...
...
@@ -123,19 +123,19 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
@Nullable
@Override
public
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DB
PDriverContext
context
)
throws
IOException
{
public
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DB
RProgressMonitor
monitor
)
throws
IOException
{
List
<
DriverLibraryMavenDependency
>
dependencies
=
new
ArrayList
<>();
MavenArtifactVersion
localVersion
=
resolveLocalVersion
(
context
,
false
);
MavenArtifactVersion
localVersion
=
resolveLocalVersion
(
monitor
,
false
);
if
(
localVersion
!=
null
)
{
List
<
MavenArtifactDependency
>
artifactDeps
=
localVersion
.
getDependencies
(
context
);
List
<
MavenArtifactDependency
>
artifactDeps
=
localVersion
.
getDependencies
(
monitor
);
if
(!
CommonUtils
.
isEmpty
(
artifactDeps
))
{
for
(
MavenArtifactDependency
dependency
:
artifactDeps
)
{
if
(
isDependencyExcluded
(
context
,
dependency
))
{
if
(
isDependencyExcluded
(
monitor
,
dependency
))
{
continue
;
}
MavenArtifactVersion
depArtifact
=
MavenRegistry
.
getInstance
().
findArtifact
(
context
,
localVersion
,
dependency
);
MavenArtifactVersion
depArtifact
=
MavenRegistry
.
getInstance
().
findArtifact
(
monitor
,
localVersion
,
dependency
);
if
(
depArtifact
!=
null
)
{
dependencies
.
add
(
new
DriverLibraryMavenDependency
(
...
...
@@ -152,7 +152,7 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
return
dependencies
;
}
protected
boolean
isDependencyExcluded
(
DB
PDriverContext
context
,
MavenArtifactDependency
dependency
)
{
protected
boolean
isDependencyExcluded
(
DB
RProgressMonitor
monitor
,
MavenArtifactDependency
dependency
)
{
return
false
;
}
...
...
@@ -181,10 +181,10 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
return
UIIcon
.
APACHE
;
}
public
void
downloadLibraryFile
(
@NotNull
DB
PDriverContext
context
,
boolean
forceUpdate
,
String
taskName
)
throws
IOException
,
InterruptedException
{
public
void
downloadLibraryFile
(
@NotNull
DB
RProgressMonitor
monitor
,
boolean
forceUpdate
,
String
taskName
)
throws
IOException
,
InterruptedException
{
//monitor.beginTask(taskName + " - update localVersion information", 1);
try
{
MavenArtifactVersion
localVersion
=
resolveLocalVersion
(
context
,
forceUpdate
);
MavenArtifactVersion
localVersion
=
resolveLocalVersion
(
monitor
,
forceUpdate
);
if
(
localVersion
.
getArtifact
().
getRepository
().
getType
()
==
MavenRepository
.
RepositoryType
.
LOCAL
)
{
// No need to download local artifacts
return
;
...
...
@@ -192,14 +192,14 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
}
finally
{
//monitor.done();
}
super
.
downloadLibraryFile
(
context
,
forceUpdate
,
taskName
);
super
.
downloadLibraryFile
(
monitor
,
forceUpdate
,
taskName
);
}
protected
MavenArtifactVersion
resolveLocalVersion
(
DB
PDriverContext
context
,
boolean
forceUpdate
)
throws
IOException
{
protected
MavenArtifactVersion
resolveLocalVersion
(
DB
RProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
{
if
(
forceUpdate
)
{
MavenRegistry
.
getInstance
().
resetArtifactInfo
(
reference
);
}
MavenArtifactVersion
version
=
getArtifactVersion
(
context
);
MavenArtifactVersion
version
=
getArtifactVersion
(
monitor
);
if
(
version
==
null
)
{
throw
new
IOException
(
"Maven artifact '"
+
path
+
"' not found"
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenDependency.java
浏览文件 @
5a64c29e
...
...
@@ -17,7 +17,7 @@
*/
package
org.jkiss.dbeaver.registry.driver
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.maven.MavenArtifactDependency
;
import
org.jkiss.dbeaver.registry.maven.MavenArtifactReference
;
import
org.jkiss.dbeaver.registry.maven.MavenArtifactVersion
;
...
...
@@ -44,7 +44,7 @@ public class DriverLibraryMavenDependency extends DriverLibraryMavenArtifact
return
true
;
}
protected
boolean
isDependencyExcluded
(
DB
PDriverContext
context
,
MavenArtifactDependency
dependency
)
{
protected
boolean
isDependencyExcluded
(
DB
RProgressMonitor
monitor
,
MavenArtifactDependency
dependency
)
{
List
<
MavenArtifactReference
>
exclusions
=
source
.
getExclusions
();
if
(
exclusions
!=
null
)
{
for
(
MavenArtifactReference
exReference
:
exclusions
)
{
...
...
@@ -54,7 +54,7 @@ public class DriverLibraryMavenDependency extends DriverLibraryMavenArtifact
}
}
return
parent
.
isDependencyExcluded
(
context
,
dependency
);
return
parent
.
isDependencyExcluded
(
monitor
,
dependency
);
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryRepository.java
浏览文件 @
5a64c29e
...
...
@@ -19,7 +19,7 @@ package org.jkiss.dbeaver.registry.driver;
import
org.eclipse.core.runtime.IConfigurationElement
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
/**
* DriverLibraryDescriptor
...
...
@@ -49,7 +49,7 @@ public class DriverLibraryRepository extends DriverLibraryLocal
@Nullable
@Override
public
String
getExternalURL
(
DB
PDriverContext
context
)
{
public
String
getExternalURL
(
DB
RProgressMonitor
monitor
)
{
String
localPath
=
getLocalFilePath
();
String
primarySource
=
DriverDescriptor
.
getDriversPrimarySource
();
if
(!
primarySource
.
endsWith
(
"/"
)
&&
!
localPath
.
startsWith
(
"/"
))
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifact.java
浏览文件 @
5a64c29e
...
...
@@ -20,7 +20,7 @@ package org.jkiss.dbeaver.registry.maven;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.maven.versioning.DefaultArtifactVersion
;
import
org.jkiss.dbeaver.registry.maven.versioning.VersionRange
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
...
...
@@ -70,14 +70,14 @@ public class MavenArtifact
this
.
artifactId
=
artifactId
;
}
public
void
loadMetadata
(
DB
PDriverContext
context
)
throws
IOException
{
public
void
loadMetadata
(
DB
RProgressMonitor
monitor
)
throws
IOException
{
latestVersion
=
null
;
releaseVersion
=
null
;
versions
.
clear
();
lastUpdate
=
null
;
String
metadataPath
=
getArtifactURL
()
+
MAVEN_METADATA_XML
;
context
.
getMonitor
()
.
subTask
(
"Load metadata "
+
this
+
""
);
monitor
.
subTask
(
"Load metadata "
+
this
+
""
);
try
(
InputStream
mdStream
=
RuntimeUtils
.
openConnectionStream
(
metadataPath
))
{
parseMetadata
(
mdStream
);
...
...
@@ -91,7 +91,7 @@ public class MavenArtifact
log
.
warn
(
"Error parsing artifact directory"
,
e
);
}
}
finally
{
context
.
getMonitor
()
.
worked
(
1
);
monitor
.
worked
(
1
);
}
metadataLoaded
=
true
;
}
...
...
@@ -173,14 +173,6 @@ public class MavenArtifact
return
localVersions
;
}
// public String getActiveVersionName() {
// return activeVersion;
// }
//
// public void setActiveVersionName(String activeVersion) {
// this.activeVersion = activeVersion;
// }
private
String
getArtifactURL
()
{
String
dir
=
groupId
.
replace
(
'.'
,
'/'
)
+
"/"
+
artifactId
;
return
repository
.
getUrl
()
+
dir
+
"/"
;
...
...
@@ -219,10 +211,10 @@ public class MavenArtifact
localVersions
.
add
(
version
);
}
private
MavenArtifactVersion
makeLocalVersion
(
DB
PDriverContext
context
,
String
versionStr
,
boolean
setActive
)
throws
IllegalArgumentException
,
IOException
{
private
MavenArtifactVersion
makeLocalVersion
(
DB
RProgressMonitor
monitor
,
String
versionStr
,
boolean
setActive
)
throws
IllegalArgumentException
,
IOException
{
MavenArtifactVersion
version
=
getVersion
(
versionStr
);
if
(
version
==
null
)
{
version
=
new
MavenArtifactVersion
(
context
,
this
,
versionStr
);
version
=
new
MavenArtifactVersion
(
monitor
,
this
,
versionStr
);
localVersions
.
add
(
version
);
}
// if (setActive) {
...
...
@@ -233,7 +225,7 @@ public class MavenArtifact
}
/*
public MavenArtifactVersion resolveActiveVersion(DB
PDriverContext context
) throws IOException {
public MavenArtifactVersion resolveActiveVersion(DB
RProgressMonitor monitor
) throws IOException {
if (CommonUtils.isEmpty(activeVersion)) {
return null;
}
...
...
@@ -246,7 +238,7 @@ public class MavenArtifact
}
*/
public
MavenArtifactVersion
resolveVersion
(
DB
PDriverContext
context
,
String
versionRef
)
throws
IOException
{
public
MavenArtifactVersion
resolveVersion
(
DB
RProgressMonitor
monitor
,
String
versionRef
)
throws
IOException
{
if
(
CommonUtils
.
isEmpty
(
versionRef
))
{
throw
new
IOException
(
"Empty artifact "
+
this
+
" version"
);
}
...
...
@@ -262,7 +254,7 @@ public class MavenArtifact
predefinedVersion
;
if
(
lookupVersion
&&
!
metadataLoaded
)
{
loadMetadata
(
context
);
loadMetadata
(
monitor
);
}
String
versionInfo
;
...
...
@@ -316,7 +308,7 @@ public class MavenArtifact
MavenArtifactVersion
localVersion
=
getVersion
(
versionInfo
);
if
(
localVersion
==
null
)
{
localVersion
=
makeLocalVersion
(
context
,
versionInfo
,
lookupVersion
);
localVersion
=
makeLocalVersion
(
monitor
,
versionInfo
,
lookupVersion
);
}
return
localVersion
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
浏览文件 @
5a64c29e
...
...
@@ -19,7 +19,7 @@ package org.jkiss.dbeaver.registry.maven;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
import
org.jkiss.dbeaver.utils.GeneralUtils
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -82,11 +82,11 @@ public class MavenArtifactVersion {
}
};
MavenArtifactVersion
(
@NotNull
DB
PDriverContext
context
,
@NotNull
MavenArtifact
artifact
,
@NotNull
String
version
)
throws
IOException
{
MavenArtifactVersion
(
@NotNull
DB
RProgressMonitor
monitor
,
@NotNull
MavenArtifact
artifact
,
@NotNull
String
version
)
throws
IOException
{
this
.
artifact
=
artifact
;
this
.
version
=
version
;
loadPOM
(
context
);
loadPOM
(
monitor
);
}
public
MavenArtifact
getArtifact
()
{
...
...
@@ -121,7 +121,7 @@ public class MavenArtifactVersion {
return
profiles
;
}
public
List
<
MavenArtifactDependency
>
getDependencies
(
DB
PDriverContext
context
)
{
public
List
<
MavenArtifactDependency
>
getDependencies
(
DB
RProgressMonitor
monitor
)
{
List
<
MavenArtifactDependency
>
dependencies
=
new
ArrayList
<>();
for
(
MavenProfile
profile
:
profiles
)
{
if
(
profile
.
isActive
()
&&
!
CommonUtils
.
isEmpty
(
profile
.
dependencies
))
{
...
...
@@ -129,7 +129,7 @@ public class MavenArtifactVersion {
}
}
if
(
parent
!=
null
)
{
List
<
MavenArtifactDependency
>
parentDependencies
=
parent
.
getDependencies
(
context
);
List
<
MavenArtifactDependency
>
parentDependencies
=
parent
.
getDependencies
(
monitor
);
if
(!
CommonUtils
.
isEmpty
(
parentDependencies
))
{
dependencies
.
addAll
(
parentDependencies
);
}
...
...
@@ -197,13 +197,13 @@ public class MavenArtifactVersion {
}
}
private
void
loadPOM
(
DB
PDriverContext
context
)
throws
IOException
{
private
void
loadPOM
(
DB
RProgressMonitor
monitor
)
throws
IOException
{
File
localPOM
=
getLocalPOM
();
if
(!
localPOM
.
exists
())
{
cachePOM
(
localPOM
);
}
context
.
getMonitor
()
.
subTask
(
"Load POM "
+
this
);
monitor
.
subTask
(
"Load POM "
+
this
);
Document
pomDocument
;
try
(
InputStream
mdStream
=
new
FileInputStream
(
localPOM
))
{
...
...
@@ -234,7 +234,7 @@ public class MavenArtifactVersion {
if
(
this
.
version
==
null
)
{
this
.
version
=
parentReference
.
getVersion
();
}
parent
=
MavenRegistry
.
getInstance
().
findArtifact
(
context
,
this
,
parentReference
);
parent
=
MavenRegistry
.
getInstance
().
findArtifact
(
monitor
,
this
,
parentReference
);
if
(
parent
==
null
)
{
log
.
error
(
"Artifact ["
+
this
+
"] parent ["
+
parentReference
+
"] not found"
);
}
...
...
@@ -259,7 +259,7 @@ public class MavenArtifactVersion {
MavenProfile
defaultProfile
=
new
MavenProfile
(
DEFAULT_PROFILE_ID
);
defaultProfile
.
active
=
true
;
profiles
.
add
(
defaultProfile
);
parseProfile
(
context
,
defaultProfile
,
root
);
parseProfile
(
monitor
,
defaultProfile
,
root
);
{
// Profiles
...
...
@@ -268,15 +268,15 @@ public class MavenArtifactVersion {
for
(
Element
profElement
:
XMLUtils
.
getChildElementList
(
licensesElement
,
"profile"
))
{
MavenProfile
profile
=
new
MavenProfile
(
XMLUtils
.
getChildElementBody
(
profElement
,
"id"
));
profiles
.
add
(
profile
);
parseProfile
(
context
,
profile
,
profElement
);
parseProfile
(
monitor
,
profile
,
profElement
);
}
}
}
context
.
getMonitor
()
.
worked
(
1
);
monitor
.
worked
(
1
);
}
private
void
parseProfile
(
DB
PDriverContext
context
,
MavenProfile
profile
,
Element
element
)
{
private
void
parseProfile
(
DB
RProgressMonitor
monitor
,
MavenProfile
profile
,
Element
element
)
{
{
// Activation
Element
activationElement
=
XMLUtils
.
getChildElement
(
element
,
"activation"
);
...
...
@@ -347,13 +347,13 @@ public class MavenArtifactVersion {
// Dependencies
Element
dmElement
=
XMLUtils
.
getChildElement
(
element
,
"dependencyManagement"
);
if
(
dmElement
!=
null
)
{
profile
.
dependencyManagement
=
parseDependencies
(
context
,
dmElement
,
true
);
profile
.
dependencyManagement
=
parseDependencies
(
monitor
,
dmElement
,
true
);
}
profile
.
dependencies
=
parseDependencies
(
context
,
element
,
false
);
profile
.
dependencies
=
parseDependencies
(
monitor
,
element
,
false
);
}
}
private
List
<
MavenArtifactDependency
>
parseDependencies
(
DB
PDriverContext
context
,
Element
element
,
boolean
depManagement
)
{
private
List
<
MavenArtifactDependency
>
parseDependencies
(
DB
RProgressMonitor
monitor
,
Element
element
,
boolean
depManagement
)
{
List
<
MavenArtifactDependency
>
result
=
new
ArrayList
<>();
Element
dependenciesElement
=
XMLUtils
.
getChildElement
(
element
,
"dependencies"
);
if
(
dependenciesElement
!=
null
)
{
...
...
@@ -383,7 +383,7 @@ public class MavenArtifactVersion {
groupId
,
artifactId
,
version
);
MavenArtifactVersion
importedVersion
=
MavenRegistry
.
getInstance
().
findArtifact
(
context
,
this
,
importReference
);
MavenArtifactVersion
importedVersion
=
MavenRegistry
.
getInstance
().
findArtifact
(
monitor
,
this
,
importReference
);
if
(
importedVersion
==
null
)
{
log
.
error
(
"Imported artifact ["
+
importReference
+
"] not found. Skip."
);
}
...
...
@@ -395,7 +395,7 @@ public class MavenArtifactVersion {
// TODO: maybe we should include optional or PROVIDED
if
(
version
==
null
)
{
version
=
findDependencyVersion
(
context
,
groupId
,
artifactId
);
version
=
findDependencyVersion
(
monitor
,
groupId
,
artifactId
);
}
if
(
version
==
null
)
{
log
.
error
(
"Can't resolve artifact ["
+
groupId
+
":"
+
artifactId
+
"] version. Skip."
);
...
...
@@ -437,7 +437,7 @@ public class MavenArtifactVersion {
scope == MavenArtifactDependency.Scope.PROVIDED*/
;
}
private
String
findDependencyVersion
(
DB
PDriverContext
context
,
String
groupId
,
String
artifactId
)
{
private
String
findDependencyVersion
(
DB
RProgressMonitor
monitor
,
String
groupId
,
String
artifactId
)
{
for
(
MavenProfile
profile
:
profiles
)
{
if
(
profile
.
isActive
()
&&
profile
.
dependencyManagement
!=
null
)
{
for
(
MavenArtifactDependency
dmArtifact
:
profile
.
dependencyManagement
)
{
...
...
@@ -451,13 +451,13 @@ public class MavenArtifactVersion {
// Check in imported BOMs
if
(
imports
!=
null
)
{
for
(
MavenArtifactVersion
i
:
imports
)
{
String
dependencyVersion
=
i
.
findDependencyVersion
(
context
,
groupId
,
artifactId
);
String
dependencyVersion
=
i
.
findDependencyVersion
(
monitor
,
groupId
,
artifactId
);
if
(
dependencyVersion
!=
null
)
{
return
dependencyVersion
;
}
}
}
return
parent
==
null
?
null
:
parent
.
findDependencyVersion
(
context
,
groupId
,
artifactId
);
return
parent
==
null
?
null
:
parent
.
findDependencyVersion
(
monitor
,
groupId
,
artifactId
);
}
private
String
evaluateString
(
String
value
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRegistry.java
浏览文件 @
5a64c29e
...
...
@@ -24,7 +24,7 @@ import org.jkiss.code.Nullable;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
import
org.jkiss.utils.CommonUtils
;
import
java.io.IOException
;
...
...
@@ -120,12 +120,12 @@ public class MavenRegistry
}
@Nullable
public
MavenArtifactVersion
findArtifact
(
@NotNull
DB
PDriverContext
context
,
@Nullable
MavenArtifactVersion
owner
,
@NotNull
MavenArtifactReference
ref
)
{
public
MavenArtifactVersion
findArtifact
(
@NotNull
DB
RProgressMonitor
monitor
,
@Nullable
MavenArtifactVersion
owner
,
@NotNull
MavenArtifactReference
ref
)
{
String
fullId
=
ref
.
getId
();
if
(
notFoundArtifacts
.
contains
(
fullId
))
{
return
null
;
}
MavenArtifactVersion
artifact
=
findInRepositories
(
context
,
owner
,
ref
);
MavenArtifactVersion
artifact
=
findInRepositories
(
monitor
,
owner
,
ref
);
if
(
artifact
!=
null
)
{
return
artifact
;
}
...
...
@@ -145,10 +145,10 @@ public class MavenRegistry
}
@Nullable
private
MavenArtifactVersion
findInRepositories
(
@NotNull
DB
PDriverContext
context
,
MavenArtifactVersion
owner
,
@NotNull
MavenArtifactReference
ref
)
{
private
MavenArtifactVersion
findInRepositories
(
@NotNull
DB
RProgressMonitor
monitor
,
MavenArtifactVersion
owner
,
@NotNull
MavenArtifactReference
ref
)
{
MavenRepository
currentRepository
=
owner
==
null
?
null
:
owner
.
getArtifact
().
getRepository
();
if
(
currentRepository
!=
null
)
{
MavenArtifactVersion
artifact
=
currentRepository
.
findArtifact
(
context
,
ref
);
MavenArtifactVersion
artifact
=
currentRepository
.
findArtifact
(
monitor
,
ref
);
if
(
artifact
!=
null
)
{
return
artifact
;
}
...
...
@@ -157,7 +157,7 @@ public class MavenRegistry
// Try all available repositories (without resolve)
for
(
MavenRepository
repository
:
repositories
)
{
if
(
repository
!=
currentRepository
)
{
MavenArtifactVersion
artifact
=
repository
.
findArtifact
(
context
,
ref
);
MavenArtifactVersion
artifact
=
repository
.
findArtifact
(
monitor
,
ref
);
if
(
artifact
!=
null
)
{
return
artifact
;
}
...
...
@@ -167,7 +167,7 @@ public class MavenRegistry
// Try context repositories
for
(
MavenRepository
repository
:
owner
.
getActiveRepositories
())
{
if
(
repository
!=
currentRepository
)
{
MavenArtifactVersion
artifact
=
repository
.
findArtifact
(
context
,
ref
);
MavenArtifactVersion
artifact
=
repository
.
findArtifact
(
monitor
,
ref
);
if
(
artifact
!=
null
)
{
return
artifact
;
}
...
...
@@ -176,7 +176,7 @@ public class MavenRegistry
}
if
(
localRepository
!=
currentRepository
)
{
MavenArtifactVersion
artifact
=
localRepository
.
findArtifact
(
context
,
ref
);
MavenArtifactVersion
artifact
=
localRepository
.
findArtifact
(
monitor
,
ref
);
if
(
artifact
!=
null
)
{
return
artifact
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
浏览文件 @
5a64c29e
...
...
@@ -22,7 +22,7 @@ import org.jkiss.code.NotNull;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.DBeaverActivator
;
import
org.jkiss.dbeaver.model.
connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.
runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.RegistryConstants
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -42,18 +42,8 @@ public class MavenRepository
public
static
final
String
EXTENSION_ID
=
"org.jkiss.dbeaver.mavenRepository"
;
public
static
final
String
METADATA_CACHE_FILE
=
"metadata-cache.xml"
;
public
static
final
String
TAG_CACHE
=
"cache"
;
public
static
final
String
TAG_ARTIFACT
=
"artifact"
;
public
static
final
String
TAG_VERSION
=
"version"
;
public
static
final
String
ATTR_ID
=
"id"
;
public
static
final
String
ATTR_NAME
=
"name"
;
public
static
final
String
ATTR_URL
=
"url"
;
public
static
final
String
ATTR_GROUP_ID
=
"groupId"
;
public
static
final
String
ATTR_ARTIFACT_ID
=
"artifactId"
;
public
static
final
String
ATTR_VERSION
=
"version"
;
public
enum
RepositoryType
{
GLOBAL
,
// Globally defined repositories (came from plugin.xml)
...
...
@@ -67,8 +57,6 @@ public class MavenRepository
private
final
String
url
;
private
final
RepositoryType
type
;
private
transient
volatile
boolean
needsToSave
=
false
;
private
Map
<
String
,
MavenArtifact
>
cachedArtifacts
=
new
LinkedHashMap
<>();
public
MavenRepository
(
IConfigurationElement
config
)
...
...
@@ -88,10 +76,6 @@ public class MavenRepository
this
.
type
=
type
;
}
public
void
flushCache
()
{
needsToSave
=
true
;
}
public
String
getId
()
{
return
id
;
}
...
...
@@ -109,7 +93,7 @@ public class MavenRepository
}
@Nullable
public
synchronized
MavenArtifactVersion
findArtifact
(
DB
PDriverContext
context
,
@NotNull
MavenArtifactReference
ref
)
{
public
synchronized
MavenArtifactVersion
findArtifact
(
DB
RProgressMonitor
monitor
,
@NotNull
MavenArtifactReference
ref
)
{
boolean
newArtifact
=
false
;
MavenArtifact
artifact
=
cachedArtifacts
.
get
(
ref
.
getId
());
if
(
artifact
==
null
)
{
...
...
@@ -117,10 +101,9 @@ public class MavenRepository
newArtifact
=
true
;
}
try
{
MavenArtifactVersion
version
=
artifact
.
resolveVersion
(
context
,
ref
.
getVersion
());
MavenArtifactVersion
version
=
artifact
.
resolveVersion
(
monitor
,
ref
.
getVersion
());
if
(
newArtifact
)
{
cachedArtifacts
.
put
(
ref
.
getId
(),
artifact
);
flushCache
();
}
return
version
;
}
catch
(
IOException
e
)
{
...
...
@@ -165,7 +148,7 @@ public class MavenRepository
if (!cacheFile.exists()) {
return;
}
try (final DB
PDriverContext context
= new DBPDriverContext(VoidProgressMonitor.INSTANCE)) {
try (final DB
RProgressMonitor monitor
= new DBPDriverContext(VoidProgressMonitor.INSTANCE)) {
InputStream mdStream = new FileInputStream(cacheFile);
try {
SAXReader reader = new SAXReader(mdStream);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
浏览文件 @
5a64c29e
...
...
@@ -23,7 +23,6 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.*
;
import
org.jkiss.dbeaver.model.connection.DBPDriverContext
;
import
org.jkiss.dbeaver.model.connection.DBPDriverDependencies
;
import
org.jkiss.dbeaver.model.connection.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
...
@@ -38,7 +37,7 @@ import org.jkiss.utils.CommonUtils;
import
java.io.IOException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.
*
;
import
java.util.
Collection
;
import
java.util.List
;
class
DriverDownloadAutoPage
extends
DriverDownloadPage
{
...
...
@@ -95,8 +94,8 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
monitor
.
beginTask
(
"Resolve dependencies"
,
100
);
try
(
DBPDriverContext
context
=
new
DBPDriverContext
(
monitor
))
{
getWizard
().
getDependencies
().
resolveDependencies
(
context
);
try
{
getWizard
().
getDependencies
().
resolveDependencies
(
monitor
);
}
catch
(
Exception
e
)
{
throw
new
InvocationTargetException
(
e
);
}
finally
{
...
...
@@ -249,14 +248,13 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
private
class
LibraryDownloader
implements
DBRRunnableWithProgress
{
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
DBPDriverContext
context
=
new
DBPDriverContext
(
monitor
);
List
<
DBPDriverLibrary
>
files
=
getWizard
().
getDependencies
().
getLibraryList
();
for
(
int
i
=
0
,
filesSize
=
files
.
size
();
i
<
filesSize
;
)
{
DBPDriverLibrary
lib
=
files
.
get
(
i
);
int
result
=
IDialogConstants
.
OK_ID
;
try
{
lib
.
downloadLibraryFile
(
context
,
false
,
"Download "
+
(
i
+
1
)
+
"/"
+
filesSize
);
lib
.
downloadLibraryFile
(
monitor
,
false
,
"Download "
+
(
i
+
1
)
+
"/"
+
filesSize
);
}
catch
(
IOException
e
)
{
if
(
lib
.
getType
()
==
DBPDriverLibrary
.
FileType
.
license
)
{
result
=
IDialogConstants
.
OK_ID
;
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPDriverContext.java
已删除
100644 → 0
浏览文件 @
b624899c
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package
org.jkiss.dbeaver.model.connection
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
java.util.*
;
/**
* Driver resolve context
*/
public
class
DBPDriverContext
implements
AutoCloseable
{
static
final
Log
log
=
Log
.
getLog
(
DBPDriverContext
.
class
);
private
final
DBRProgressMonitor
monitor
;
private
final
Date
initTime
=
new
Date
();
private
final
Map
<
String
,
String
>
properties
=
new
HashMap
<>();
private
final
Map
<
Class
,
AutoCloseable
>
infoMap
=
new
HashMap
<>();
public
DBPDriverContext
(
DBRProgressMonitor
monitor
)
{
this
.
monitor
=
monitor
;
}
public
DBRProgressMonitor
getMonitor
()
{
return
monitor
;
}
public
Date
getInitTime
()
{
return
initTime
;
}
public
Map
<
String
,
String
>
getProperties
()
{
return
properties
;
}
@NotNull
public
<
T
extends
AutoCloseable
>
T
getInfo
(
Class
<
T
>
type
)
{
AutoCloseable
o
=
infoMap
.
get
(
type
);
if
(
o
==
null
)
{
try
{
o
=
type
.
newInstance
();
}
catch
(
Exception
e
)
{
throw
new
IllegalArgumentException
(
"Can't create context info "
+
type
.
getName
(),
e
);
}
infoMap
.
put
(
type
,
o
);
}
return
type
.
cast
(
o
);
}
@Override
public
void
close
()
{
for
(
AutoCloseable
info
:
infoMap
.
values
())
{
try
{
info
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
);
}
}
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPDriverDependencies.java
浏览文件 @
5a64c29e
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.model.connection
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -49,5 +50,5 @@ public interface DBPDriverDependencies
List
<
DependencyNode
>
getLibraryMap
();
void
resolveDependencies
(
DB
PDriverContext
context
)
throws
DBException
;
void
resolveDependencies
(
DB
RProgressMonitor
monitor
)
throws
DBException
;
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPDriverLibrary.java
浏览文件 @
5a64c29e
...
...
@@ -21,6 +21,7 @@ package org.jkiss.dbeaver.model.connection;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
java.io.File
;
import
java.io.IOException
;
...
...
@@ -84,10 +85,10 @@ public interface DBPDriverLibrary
boolean
isResolved
();
void
resolve
(
DB
PDriverContext
context
)
throws
IOException
;
void
resolve
(
DB
RProgressMonitor
monitor
)
throws
IOException
;
@Nullable
String
getExternalURL
(
DB
PDriverContext
context
);
String
getExternalURL
(
DB
RProgressMonitor
monitor
);
@Nullable
File
getLocalFile
();
...
...
@@ -95,8 +96,8 @@ public interface DBPDriverLibrary
boolean
matchesCurrentPlatform
();
@Nullable
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DB
PDriverContext
context
)
throws
IOException
;
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DB
RProgressMonitor
monitor
)
throws
IOException
;
void
downloadLibraryFile
(
@NotNull
DB
PDriverContext
context
,
boolean
forceUpdate
,
String
taskName
)
void
downloadLibraryFile
(
@NotNull
DB
RProgressMonitor
monitor
,
boolean
forceUpdate
,
String
taskName
)
throws
IOException
,
InterruptedException
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录