提交 06c649a5 编写于 作者: J jurgen

Local maven repository

上级 30981766
......@@ -103,6 +103,10 @@ public class MavenRepository
return predefined;
}
public boolean isLocal() {
return false;
}
@Nullable
public MavenArtifact findArtifact(@NotNull String groupId, @NotNull String artifactId) {
for (MavenArtifact artifact : cachedArtifacts) {
......
......@@ -289,17 +289,23 @@ public class RuntimeUtils {
}
URL url = new URL(urlString);
final HttpURLConnection connection = (HttpURLConnection) (proxy == null ? url.openConnection() : url.openConnection(proxy));
final URLConnection connection = (proxy == null ? url.openConnection() : url.openConnection(proxy));
connection.setReadTimeout(10000);
connection.setConnectTimeout(10000);
connection.setRequestMethod("GET"); //$NON-NLS-1$
connection.setInstanceFollowRedirects(true);
connection.setRequestProperty(
"User-Agent", //$NON-NLS-1$
DBeaverCore.getProductTitle());
if (connection instanceof HttpURLConnection) {
final HttpURLConnection httpConnection = (HttpURLConnection) connection;
httpConnection.setRequestMethod("GET"); //$NON-NLS-1$
httpConnection.setInstanceFollowRedirects(true);
connection.setRequestProperty(
"User-Agent", //$NON-NLS-1$
DBeaverCore.getProductTitle());
}
connection.connect();
if (connection.getResponseCode() != 200) {
throw new IOException("File not found '" + urlString + "': " + connection.getResponseMessage());
if (connection instanceof HttpURLConnection) {
final HttpURLConnection httpConnection = (HttpURLConnection) connection;
if (httpConnection.getResponseCode() != 200) {
throw new IOException("File not found '" + urlString + "': " + httpConnection.getResponseMessage());
}
}
return connection;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册