mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
IDEA-220227 - get rid of old wadl-core library, replaced with simple REST http queries
GitOrigin-RevId: 02b7b441d5722792a9209f3d6380c619b3ed0ee7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7e9137b7dd
commit
9118f09b00
@@ -49,15 +49,6 @@
|
||||
<orderEntry type="module" module-name="intellij.java.uast" />
|
||||
<orderEntry type="library" name="gson" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.java.compiler" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="wadl-core">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../../lib/wadl-core.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="jaxb-api" level="project" />
|
||||
<orderEntry type="library" name="javax.activation" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="jaxb-runtime" level="project" />
|
||||
|
||||
@@ -17,10 +17,19 @@ package com.intellij.jarRepository.services;
|
||||
|
||||
import com.intellij.jarRepository.RemoteRepositoryDescription;
|
||||
import com.intellij.jarRepository.RepositoryArtifactDescription;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.Url;
|
||||
import com.intellij.util.Urls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Gregory.Shrago
|
||||
@@ -33,10 +42,40 @@ public abstract class MavenRepositoryService {
|
||||
public abstract List<RemoteRepositoryDescription> getRepositories(@NotNull String url) throws IOException;
|
||||
|
||||
@NotNull
|
||||
public abstract List<RepositoryArtifactDescription> findArtifacts(@NotNull String url, @NotNull RepositoryArtifactDescription template) throws IOException;
|
||||
public abstract List<RepositoryArtifactDescription> findArtifacts(@NotNull String url, @NotNull RepositoryArtifactDescription template)
|
||||
throws IOException;
|
||||
|
||||
|
||||
public final String toString() {
|
||||
return getDisplayName();
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
protected String mapToParamString(@NotNull Map<String, String> params) {
|
||||
return StringUtil.join(params.entrySet(), entry -> {
|
||||
if (entry.getValue() == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), "UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException ignore) {
|
||||
return null;
|
||||
}
|
||||
}, "&");
|
||||
}
|
||||
|
||||
protected Url toUrl(@NotNull String base, @NotNull String path) throws MalformedURLException {
|
||||
return toUrl(base, path, null);
|
||||
}
|
||||
|
||||
protected Url toUrl(@NotNull String base, @NotNull String path, @Nullable String parameters) throws MalformedURLException {
|
||||
Url baseUrl = Urls.parse(base, false);
|
||||
if (baseUrl == null || baseUrl.getScheme() == null || baseUrl.getAuthority() == null) {
|
||||
throw new MalformedURLException("cannot parse " + base);
|
||||
}
|
||||
String newPath = baseUrl.getPath().endsWith("/") ? baseUrl.getPath() + path : baseUrl.getPath() + "/" + path;
|
||||
return Urls.newUrl(baseUrl.getScheme(), baseUrl.getAuthority(), newPath, parameters == null ? null : "?" + parameters);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,23 +6,26 @@ import com.google.gson.JsonSyntaxException;
|
||||
import com.intellij.jarRepository.RemoteRepositoryDescription;
|
||||
import com.intellij.jarRepository.RepositoryArtifactDescription;
|
||||
import com.intellij.jarRepository.services.MavenRepositoryService;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.Url;
|
||||
import com.intellij.util.io.HttpRequests;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Gregory.Shrago
|
||||
*/
|
||||
|
||||
//use some endpoints from http://repo.jfrog.org/artifactory/api/
|
||||
public class ArtifactoryRepositoryService extends MavenRepositoryService {
|
||||
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
@@ -32,11 +35,14 @@ public class ArtifactoryRepositoryService extends MavenRepositoryService {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<RemoteRepositoryDescription> getRepositories(@NotNull String url) throws IOException {
|
||||
assert !ApplicationManager.getApplication().isDispatchThread();
|
||||
try {
|
||||
final Gson gson = new Gson();
|
||||
final InputStreamReader stream =
|
||||
new InputStreamReader(new Endpoint.Repositories(url).getRepositoryDetailsListJson(null).getInputStream(), StandardCharsets.UTF_8);
|
||||
final ArtifactoryModel.RepositoryType[] repos = gson.fromJson(stream, ArtifactoryModel.RepositoryType[].class);
|
||||
ArtifactoryModel.RepositoryType[] repos = gson.fromJson(
|
||||
HttpRequests.request(toUrl(url, "repositories"))
|
||||
.productNameAsUserAgent()
|
||||
.readString(),
|
||||
ArtifactoryModel.RepositoryType[].class
|
||||
);
|
||||
final List<RemoteRepositoryDescription> result = new ArrayList<>(repos.length);
|
||||
for (ArtifactoryModel.RepositoryType repo : repos) {
|
||||
result.add(convert(repo));
|
||||
@@ -57,42 +63,19 @@ public class ArtifactoryRepositoryService extends MavenRepositoryService {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<RepositoryArtifactDescription> findArtifacts(@NotNull String url, @NotNull RepositoryArtifactDescription template) throws IOException {
|
||||
public List<RepositoryArtifactDescription> findArtifacts(@NotNull String url, @NotNull RepositoryArtifactDescription template)
|
||||
throws IOException {
|
||||
assert !ApplicationManager.getApplication().isDispatchThread();
|
||||
try {
|
||||
final String packaging = StringUtil.notNullize(template.getPackaging());
|
||||
final ArrayList<RepositoryArtifactDescription> artifacts = new ArrayList<>();
|
||||
final Gson gson = new Gson();
|
||||
|
||||
|
||||
final String className = template.getClassNames();
|
||||
if (className == null || className.length() == 0) {
|
||||
final String name = StringUtil.join(Arrays.asList(template.getGroupId(), template.getArtifactId(), template.getVersion()), ":");
|
||||
final InputStream stream = new Endpoint.Search.Artifact(url).getArtifactSearchResultJson(name, null).getInputStream();
|
||||
|
||||
final ArtifactoryModel.GavcResults results = stream == null? null : gson.fromJson(new InputStreamReader(stream,
|
||||
StandardCharsets.UTF_8), ArtifactoryModel.GavcResults.class);
|
||||
if (results != null && results.results != null) {
|
||||
for (ArtifactoryModel.GavcResult result : results.results) {
|
||||
if (!result.uri.endsWith(packaging)) continue;
|
||||
artifacts.add(convertArtifactInfo(result.uri, url, null));
|
||||
}
|
||||
}
|
||||
return searchArtifacts(url, template);
|
||||
}
|
||||
else {
|
||||
// IDEA-58225
|
||||
final String searchString = className.endsWith("*") || className.endsWith("?") ? className : className + ".class";
|
||||
final InputStream stream = new Endpoint.Search.Archive(url).getArchiveSearchResultJson(searchString, null).getInputStream();
|
||||
|
||||
final ArtifactoryModel.ArchiveResults results = stream == null? null : gson.fromJson(new InputStreamReader(stream,
|
||||
StandardCharsets.UTF_8), ArtifactoryModel.ArchiveResults.class);
|
||||
if (results != null && results.results != null) {
|
||||
for (ArtifactoryModel.ArchiveResult result : results.results) {
|
||||
for (String uri : result.archiveUris) {
|
||||
if (!uri.endsWith(packaging)) continue;
|
||||
artifacts.add(convertArtifactInfo(uri, url, result.entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
return searchArchives(url, template);
|
||||
}
|
||||
return artifacts;
|
||||
}
|
||||
catch (JsonSyntaxException e) {
|
||||
return Collections.emptyList();
|
||||
@@ -102,7 +85,63 @@ public class ArtifactoryRepositoryService extends MavenRepositoryService {
|
||||
}
|
||||
}
|
||||
|
||||
private static RepositoryArtifactDescription convertArtifactInfo(String uri, String baseUri, String className) throws IOException {
|
||||
@NotNull
|
||||
private List<RepositoryArtifactDescription> searchArchives(@NotNull String url, @NotNull RepositoryArtifactDescription template)
|
||||
throws IOException {
|
||||
final String packaging = StringUtil.notNullize(template.getPackaging());
|
||||
final ArrayList<RepositoryArtifactDescription> artifacts = new ArrayList<>();
|
||||
|
||||
String className = template.getClassNames();
|
||||
final String searchString = className.endsWith("*") || className.endsWith("?") ? className : className + ".class";
|
||||
Url requestUrl = toUrl(url, "search/archive", "name=" + URLEncoder.encode(searchString.trim(), "UTF-8"));
|
||||
ArtifactoryModel.ArchiveResults results = gson.fromJson(
|
||||
HttpRequests.request(requestUrl)
|
||||
.productNameAsUserAgent().readString(),
|
||||
ArtifactoryModel.ArchiveResults.class
|
||||
);
|
||||
|
||||
if (results != null && results.results != null) {
|
||||
for (ArtifactoryModel.ArchiveResult result : results.results) {
|
||||
for (String uri : result.archiveUris) {
|
||||
if (!uri.endsWith(packaging)) continue;
|
||||
artifacts.add(convertArtifactInfo(uri, url, result.entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<RepositoryArtifactDescription> searchArtifacts(@NotNull String url, @NotNull RepositoryArtifactDescription template)
|
||||
throws IOException {
|
||||
final String packaging = StringUtil.notNullize(template.getPackaging());
|
||||
final ArrayList<RepositoryArtifactDescription> artifacts = new ArrayList<>();
|
||||
|
||||
Map<String, String> params = new LinkedHashMap<>();
|
||||
params.put("g", template.getGroupId());
|
||||
params.put("a", template.getArtifactId());
|
||||
params.put("v", template.getVersion());
|
||||
params.put("repos", "");
|
||||
Url requestUrl = toUrl(url, "search/gavc", mapToParamString(params));
|
||||
ArtifactoryModel.GavcResults results = gson.fromJson(
|
||||
HttpRequests.request(requestUrl)
|
||||
.productNameAsUserAgent()
|
||||
.readString(),
|
||||
ArtifactoryModel.GavcResults.class
|
||||
);
|
||||
|
||||
if (results != null && results.results != null) {
|
||||
for (ArtifactoryModel.GavcResult result : results.results) {
|
||||
if (!result.uri.endsWith(packaging)) continue;
|
||||
artifacts.add(convertArtifactInfo(result.uri, url, null));
|
||||
}
|
||||
}
|
||||
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
private static RepositoryArtifactDescription convertArtifactInfo(String uri, String baseUri, String className) {
|
||||
final String repoPathFile = uri.substring((baseUri + "storage/").length());
|
||||
final int repoIndex = repoPathFile.indexOf('/');
|
||||
final String repoString = repoPathFile.substring(0, repoIndex);
|
||||
|
||||
@@ -1,360 +0,0 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.jarRepository.services.artifactory;
|
||||
|
||||
import org.jvnet.ws.wadl.util.DSDispatcher;
|
||||
import org.jvnet.ws.wadl.util.UriBuilder;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class Endpoint {
|
||||
|
||||
public static DataSource getArtifactInfoByUri(String uri) throws IOException {
|
||||
DSDispatcher _dsDispatcher = new DSDispatcher();
|
||||
UriBuilder _uriBuilder = new UriBuilder();
|
||||
_uriBuilder.addPathSegment(uri);
|
||||
String _url = _uriBuilder.buildUri(Collections.emptyMap(), Collections.emptyMap());
|
||||
DataSource _retVal =
|
||||
_dsDispatcher.doGET(_url, Collections.emptyMap(), "application/vnd.org.jfrog.artifactory.search.ArtifactSearchResult+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public static class Search {
|
||||
|
||||
public static class Artifact {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public Artifact(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("search");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("artifact");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getArtifactSearchResultJson(String name, String repos)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("name", name);
|
||||
_queryParameterValues.put("repos", repos);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/vnd.org.jfrog.artifactory.search.ArtifactSearchResult+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Gavc {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public Gavc(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("search");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("gavc");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getGavcSearchResultJson(String g, String a, String v, String c, String repos)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("g", g);
|
||||
_queryParameterValues.put("a", a);
|
||||
_queryParameterValues.put("v", v);
|
||||
_queryParameterValues.put("c", c);
|
||||
_queryParameterValues.put("repos", repos);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/vnd.org.jfrog.artifactory.search.GavcSearchResult+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
}
|
||||
public static class Archive {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public Archive(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("search");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("archive");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getArchiveSearchResultJson(String className, String repos)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("name", className);
|
||||
_queryParameterValues.put("repos", repos);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/vnd.org.jfrog.artifactory.search.ArchiveEntrySearchResult+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class System {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public System(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("system");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getAsApplicationXml()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public static class Configuration {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public Configuration(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("system");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("configuration");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource postAsTextPlain(DataSource input)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doPOST(input, "application/xml", _url, _headerParameterValues, "text/plain");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public DataSource getAsApplicationXml()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public static class RemoteRepositories {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public RemoteRepositories(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("system");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("configuration");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("remoteRepositories");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public void put(DataSource input)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doPUT(input, "application/xml", _url, _headerParameterValues, null);
|
||||
return ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class SystemVersion {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public SystemVersion(final String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("system/version");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getSystemVersionJson()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/vnd.org.jfrog.artifactory.system.Version+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Gregory.Shrago
|
||||
*/
|
||||
public static class Repositories {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public Repositories(String url)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("repositories");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getRepositoryDetailsListJson(String type)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("type", type);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/vnd.org.jfrog.artifactory.repositories.RepositoryDetailsList+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public static class RepoKeyConfiguration {
|
||||
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
*/
|
||||
public RepoKeyConfiguration(final String url, String repokey)
|
||||
{
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("repositories");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("{repoKey}/configuration");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
_templateAndMatrixParameterValues.put("repoKey", repokey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repoKey
|
||||
*
|
||||
*/
|
||||
public String getRepoKey() {
|
||||
return ((String) _templateAndMatrixParameterValues.get("repoKey"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repoKey
|
||||
*
|
||||
*/
|
||||
public void setRepoKey(String repokey) {
|
||||
_templateAndMatrixParameterValues.put("repoKey", repokey);
|
||||
}
|
||||
|
||||
public DataSource getAsApplicationVndOrgJfrogArtifactoryRepositoriesRepositoryConfigurationJson()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/vnd.org.jfrog.artifactory.repositories.RepositoryConfiguration+json");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,367 +0,0 @@
|
||||
<application xmlns="http://research.sun.com/wadl/2006/10">
|
||||
<doc xmlns:jersey="http://jersey.dev.java.net/" jersey:generatedBy="Jersey: 1.1.5.1 03/10/2010 02:33 PM"/>
|
||||
<resources base="http://repo.jfrog.org/artifactory/api/">
|
||||
<resource path="system/version">
|
||||
<method name="GET" id="getArtifactoryVersion">
|
||||
<response>
|
||||
<representation mediaType="application/vnd.org.jfrog.artifactory.system.Version+json"/>
|
||||
</response>
|
||||
</method>
|
||||
</resource>
|
||||
<!--<resource path="copy"> -->
|
||||
<!--<resource path="{path: .+}"> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="path"/> -->
|
||||
<!--<method name="POST" id="copy"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="to"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="dry"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.CopyOrMoveResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="download"> -->
|
||||
<!--<resource path="{path: .+}"> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="path"/> -->
|
||||
<!--<method name="GET" id="downloadArtifactOrFolder"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="content"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="mark"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/octet-stream"/> -->
|
||||
<!--<representation mediaType="text/plain"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="build"> -->
|
||||
<!--<method name="PUT" id="addBuild"> -->
|
||||
<!--<request> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.build.BuildInfo+json"/> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory+json"/> -->
|
||||
<!--<representation mediaType="application/json"/> -->
|
||||
<!--</request> -->
|
||||
<!--</method> -->
|
||||
<!--<method name="GET" id="getAllBuilds"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.build.Builds+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--<resource path="/{name}"> -->
|
||||
<!--<method name="GET" id="getAllSpecificBuilds"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.build.BuildsByName+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="/{name}/{buildNumber}"> -->
|
||||
<!--<method name="GET" id="getBuildInfo"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.build.BuildInfo+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="/{action}/{name}/{buildNumber}"> -->
|
||||
<!--<method name="POST" id="moveBuildItems"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="started"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="to"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="1" type="xs:int" style="query" name="arts"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="deps"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="scopes"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="dry"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.CopyOrMoveResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<resource path="search">
|
||||
<resource path="artifact">
|
||||
<method name="GET" id="getArtifactSearchResult">
|
||||
<request>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="name"/>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/>
|
||||
</request>
|
||||
<response>
|
||||
<representation mediaType="application/vnd.org.jfrog.artifactory.search.ArtifactSearchResult+json"/>
|
||||
</response>
|
||||
</method>
|
||||
</resource>
|
||||
<resource path="archive">
|
||||
<method name="GET" id="get">
|
||||
<request>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="name"/>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/>
|
||||
</request>
|
||||
<response>
|
||||
<representation mediaType="application/vnd.org.jfrog.artifactory.search.ArchiveEntrySearchResult+json"/>
|
||||
</response>
|
||||
</method>
|
||||
</resource>
|
||||
<resource path="gavc">
|
||||
<method name="GET" id="get">
|
||||
<request>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="g"/>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="a"/>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="v"/>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="c"/>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/>
|
||||
</request>
|
||||
<response>
|
||||
<representation mediaType="application/vnd.org.jfrog.artifactory.search.GavcSearchResult+json"/>
|
||||
</response>
|
||||
</method>
|
||||
</resource>
|
||||
<!--<resource path="prop"> -->
|
||||
<!--<method name="GET" id="get"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.search.MetadataSearchResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="xpath"> -->
|
||||
<!--<method name="GET" id="get"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="name"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="metadata"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="xpath"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="val"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.search.XpathSearchResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="usage"> -->
|
||||
<!--<method name="GET" id="get"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:long" style="query" name="notUsedSince"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.search.ArtifactUsageResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="creation"> -->
|
||||
<!--<method name="GET" id="get"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:long" style="query" name="from"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:long" style="query" name="to"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repos"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.search.ArtifactCreationResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="pattern"> -->
|
||||
<!--<method name="GET" id="get"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="pattern"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.search.PatternResultFileSet+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
</resource>
|
||||
<!--<resource path="traffic"> -->
|
||||
<!--<resource path="stream"> -->
|
||||
<!--<method name="GET" id="getTrafficLogFilesStream"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:long" style="query" name="start"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:long" style="query" name="end"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="text/plain"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="move"> -->
|
||||
<!--<resource path="{path: .+}"> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="path"/> -->
|
||||
<!--<method name="POST" id="move"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="to"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="dry"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.CopyOrMoveResult+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<resource path="system">
|
||||
<method name="GET" id="getSystemInfo">
|
||||
<response>
|
||||
<representation mediaType="application/xml"/>
|
||||
</response>
|
||||
</method>
|
||||
<!--<resource path="import"> -->
|
||||
<!--<method name="GET" id="settingsExample"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--<method name="POST" id="activateImport"> -->
|
||||
<!--<request> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="*/*"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="export"> -->
|
||||
<!--<method name="GET" id="settingsExample"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--<method name="POST" id="activateExport"> -->
|
||||
<!--<request> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="*/*"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<resource path="configuration">
|
||||
<method name="POST" id="setConfig">
|
||||
<request>
|
||||
<representation mediaType="application/xml"/>
|
||||
</request>
|
||||
<response>
|
||||
<representation mediaType="text/plain"/>
|
||||
</response>
|
||||
</method>
|
||||
<method name="GET" id="getConfig">
|
||||
<response>
|
||||
<representation mediaType="application/xml"/>
|
||||
</response>
|
||||
</method>
|
||||
<resource path="remoteRepositories">
|
||||
<method name="PUT" id="useRemoteRepositories">
|
||||
<request>
|
||||
<representation mediaType="application/xml"/>
|
||||
</request>
|
||||
</method>
|
||||
</resource>
|
||||
</resource>
|
||||
<!--<resource path="security"> -->
|
||||
<!--<method name="GET" id="getSecurityData"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--<method name="POST" id="importSecurityData"> -->
|
||||
<!--<request> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="text/plain"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--<resource path="logout"> -->
|
||||
<!--<method name="POST" id="logout"/> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="passwordPolicy/{policyName}"> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="policyName"/> -->
|
||||
<!--<method name="POST" id="setPasswordPolicy"/> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="storage"> -->
|
||||
<!--<resource path="size"> -->
|
||||
<!--<method name="GET" id="size"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="text/plain"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--<resource path="compress"> -->
|
||||
<!--<method name="POST" id="compress"> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/xml"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
</resource>
|
||||
<!--<resource path="storage"> -->
|
||||
<!--<resource path="{path: .+}"> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="path"/> -->
|
||||
<!--<method name="GET" id="getStorageInfo"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="mdns"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="md"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="list"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="deep"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="properties"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.FolderInfo+json"/> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.FileInfo+json"/> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.ItemMetadataNames+json"/> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.ItemProperties+json"/> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.ItemMetadata+json"/> -->
|
||||
<!--<representation mediaType="application/vnd.org.jfrog.artifactory.storage.FileList+json"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
<resource path="repositories">
|
||||
<method name="GET" id="getAllRepoDetails">
|
||||
<request>
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="type"/>
|
||||
</request>
|
||||
<response>
|
||||
<representation mediaType="application/vnd.org.jfrog.artifactory.repositories.RepositoryDetailsList+json"/>
|
||||
</response>
|
||||
</method>
|
||||
<!--<method name="POST" id="importRepositories"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="path"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="repo"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="metadata"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="verbose"/> -->
|
||||
<!--</request> -->
|
||||
<!--</method> -->
|
||||
<resource path="{repoKey}/configuration">
|
||||
<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="repoKey"/>
|
||||
<method name="GET" id="getRemoteDescriptor">
|
||||
<response>
|
||||
<representation mediaType="application/vnd.org.jfrog.artifactory.repositories.RepositoryConfiguration+json"/>
|
||||
</response>
|
||||
</method>
|
||||
</resource>
|
||||
</resource>
|
||||
<!--<resource path="sync"> -->
|
||||
<!--<resource path="{path: .+}"> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="path"/> -->
|
||||
<!--<method name="GET" id="sync"> -->
|
||||
<!--<request> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="1" type="xs:int" style="query" name="progress"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="mark"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query" name="delete"/> -->
|
||||
<!--<param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="query" name="overwrite"/> -->
|
||||
<!--</request> -->
|
||||
<!--<response> -->
|
||||
<!--<representation mediaType="text/plain"/> -->
|
||||
<!--</response> -->
|
||||
<!--</method> -->
|
||||
<!--</resource> -->
|
||||
<!--</resource> -->
|
||||
</resources>
|
||||
</application>
|
||||
@@ -1,325 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for artifactType complex type.
|
||||
* <p/>
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
* <p/>
|
||||
* <pre>
|
||||
* <complexType name="artifactType">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="resourceUri" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="artifactId" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="classifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="packaging" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="extension" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="repoId" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="contextId" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="pomLink" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="artifactLink" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "artifactType", propOrder = {
|
||||
"resourceUri",
|
||||
"groupId",
|
||||
"artifactId",
|
||||
"version",
|
||||
"classifier",
|
||||
"packaging",
|
||||
"extension",
|
||||
"repoId",
|
||||
"contextId",
|
||||
"pomLink",
|
||||
"artifactLink"
|
||||
})
|
||||
public class ArtifactType implements Serializable {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected String resourceUri;
|
||||
@XmlElement(required = true)
|
||||
protected String groupId;
|
||||
@XmlElement(required = true)
|
||||
protected String artifactId;
|
||||
@XmlElement(required = true)
|
||||
protected String version;
|
||||
@XmlElement(required = true)
|
||||
protected String classifier;
|
||||
@XmlElement(required = true)
|
||||
protected String packaging;
|
||||
@XmlElement(required = true)
|
||||
protected String extension;
|
||||
@XmlElement(required = true)
|
||||
protected String repoId;
|
||||
@XmlElement(required = true)
|
||||
protected String contextId;
|
||||
@XmlElement(required = true)
|
||||
protected String pomLink;
|
||||
@XmlElement(required = true)
|
||||
protected String artifactLink;
|
||||
|
||||
public ArtifactType() {
|
||||
|
||||
}
|
||||
|
||||
public ArtifactType(String groupId, String artifactId, String version) {
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the resourceUri property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getResourceUri() {
|
||||
return resourceUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the resourceUri property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setResourceUri(String value) {
|
||||
this.resourceUri = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the groupId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the groupId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setGroupId(String value) {
|
||||
this.groupId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artifactId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getArtifactId() {
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artifactId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtifactId(String value) {
|
||||
this.artifactId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the version property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the version property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setVersion(String value) {
|
||||
this.version = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the classifier property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getClassifier() {
|
||||
return classifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the classifier property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setClassifier(String value) {
|
||||
this.classifier = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the packaging property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getPackaging() {
|
||||
return packaging;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the packaging property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setPackaging(String value) {
|
||||
this.packaging = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the extension property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getExtension() {
|
||||
return extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the extension property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setExtension(String value) {
|
||||
this.extension = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the repoId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getRepoId() {
|
||||
return repoId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the repoId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setRepoId(String value) {
|
||||
this.repoId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the contextId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getContextId() {
|
||||
return contextId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the contextId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setContextId(String value) {
|
||||
this.contextId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the pomLink property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getPomLink() {
|
||||
return pomLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the pomLink property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setPomLink(String value) {
|
||||
this.pomLink = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artifactLink property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getArtifactLink() {
|
||||
return artifactLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artifactLink property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtifactLink(String value) {
|
||||
this.artifactLink = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return groupId + ":" + artifactId + ":" + version;
|
||||
}
|
||||
}
|
||||
@@ -1,285 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import org.jvnet.ws.wadl.util.DSDispatcher;
|
||||
import org.jvnet.ws.wadl.util.JAXBDispatcher;
|
||||
import org.jvnet.ws.wadl.util.UriBuilder;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class Endpoint {
|
||||
|
||||
|
||||
public static class DataIndex {
|
||||
|
||||
private final JAXBDispatcher _jaxbDispatcher;
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final JAXBContext _jc;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param nexusRoot
|
||||
*/
|
||||
public DataIndex(final String nexusRoot)
|
||||
throws JAXBException
|
||||
{
|
||||
_jc = JAXBContext.newInstance("com.intellij.jarRepository.services.nexus", getClass().getClassLoader());
|
||||
_jaxbDispatcher = new JAXBDispatcher(_jc);
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(nexusRoot);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("data_index");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getArtifactlistAsApplicationXml()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public SearchResults getArtifactlistAsSearchResults()
|
||||
throws IOException, JAXBException
|
||||
{
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
if (_retVal == null) {
|
||||
return null;
|
||||
}
|
||||
if (_retVal instanceof JAXBElement) {
|
||||
JAXBElement jaxbElement = ((JAXBElement) _retVal);
|
||||
_retVal = jaxbElement.getValue();
|
||||
}
|
||||
return ((SearchResults) _retVal);
|
||||
}
|
||||
|
||||
public DataSource getArtifactlistAsApplicationXml(String q, String g, String a, String v, String c)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("q", q);
|
||||
_queryParameterValues.put("g", g);
|
||||
_queryParameterValues.put("a", a);
|
||||
_queryParameterValues.put("v", v);
|
||||
_queryParameterValues.put("c", c);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public SearchResults getArtifactlistAsSearchResults(String q, String g, String a, String v, String c, String cn)
|
||||
throws IOException, JAXBException
|
||||
{
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("q", q);
|
||||
_queryParameterValues.put("g", g);
|
||||
_queryParameterValues.put("a", a);
|
||||
_queryParameterValues.put("v", v);
|
||||
_queryParameterValues.put("c", c);
|
||||
_queryParameterValues.put("cn", cn);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
if (_retVal == null) {
|
||||
return null;
|
||||
}
|
||||
if (_retVal instanceof JAXBElement) {
|
||||
JAXBElement jaxbElement = ((JAXBElement) _retVal);
|
||||
_retVal = jaxbElement.getValue();
|
||||
}
|
||||
return ((SearchResults) _retVal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class DataIndexRepository {
|
||||
|
||||
private final JAXBDispatcher _jaxbDispatcher;
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final JAXBContext _jc;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
*/
|
||||
public DataIndexRepository(String repository)
|
||||
throws JAXBException
|
||||
{
|
||||
_jc = JAXBContext.newInstance("com.intellij.jarRepository.services.nexus", getClass().getClassLoader());
|
||||
_jaxbDispatcher = new JAXBDispatcher(_jc);
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("http://repository.sonatype.org/service/local/");
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("data_index/{repository}");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
_templateAndMatrixParameterValues.put("repository", repository);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repository
|
||||
*
|
||||
*/
|
||||
public String getRepository() {
|
||||
return ((String) _templateAndMatrixParameterValues.get("repository"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repository
|
||||
*
|
||||
*/
|
||||
public void setRepository(String repository) {
|
||||
_templateAndMatrixParameterValues.put("repository", repository);
|
||||
}
|
||||
|
||||
public DataSource getArtifactlistAsApplicationXml()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public SearchResults getArtifactlistAsSearchResults()
|
||||
throws IOException, JAXBException
|
||||
{
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
if (_retVal == null) {
|
||||
return null;
|
||||
}
|
||||
if (_retVal instanceof JAXBElement) {
|
||||
JAXBElement jaxbElement = ((JAXBElement) _retVal);
|
||||
_retVal = jaxbElement.getValue();
|
||||
}
|
||||
return ((SearchResults) _retVal);
|
||||
}
|
||||
|
||||
public DataSource getArtifactlistAsApplicationXml(String q, String g, String a, String v, String c)
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("q", q);
|
||||
_queryParameterValues.put("g", g);
|
||||
_queryParameterValues.put("a", a);
|
||||
_queryParameterValues.put("v", v);
|
||||
_queryParameterValues.put("c", c);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public SearchResults getArtifactlistAsSearchResults(String q, String g, String a, String v, String c)
|
||||
throws IOException, JAXBException
|
||||
{
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
_queryParameterValues.put("q", q);
|
||||
_queryParameterValues.put("g", g);
|
||||
_queryParameterValues.put("a", a);
|
||||
_queryParameterValues.put("v", v);
|
||||
_queryParameterValues.put("c", c);
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
if (_retVal == null) {
|
||||
return null;
|
||||
}
|
||||
if (_retVal instanceof JAXBElement) {
|
||||
JAXBElement jaxbElement = ((JAXBElement) _retVal);
|
||||
_retVal = jaxbElement.getValue();
|
||||
}
|
||||
return ((SearchResults) _retVal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Repositories {
|
||||
|
||||
private final JAXBDispatcher _jaxbDispatcher;
|
||||
private final DSDispatcher _dsDispatcher;
|
||||
private final UriBuilder _uriBuilder;
|
||||
private final JAXBContext _jc;
|
||||
private final HashMap<String, Object> _templateAndMatrixParameterValues;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public Repositories(String url)
|
||||
throws JAXBException
|
||||
{
|
||||
_jc = JAXBContext.newInstance("com.intellij.jarRepository.services.nexus", getClass().getClassLoader());
|
||||
_jaxbDispatcher = new JAXBDispatcher(_jc);
|
||||
_dsDispatcher = new DSDispatcher();
|
||||
_uriBuilder = new UriBuilder();
|
||||
List<String> _matrixParamSet;
|
||||
_matrixParamSet = _uriBuilder.addPathSegment(url);
|
||||
_matrixParamSet = _uriBuilder.addPathSegment("repositories");
|
||||
_templateAndMatrixParameterValues = new HashMap<>();
|
||||
}
|
||||
|
||||
public DataSource getRepolistAsApplicationXml()
|
||||
throws IOException {
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
DataSource _retVal = _dsDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
return _retVal;
|
||||
}
|
||||
|
||||
public com.intellij.jarRepository.services.nexus.Repositories getRepolistAsRepositories()
|
||||
throws IOException, JAXBException
|
||||
{
|
||||
HashMap<String, Object> _queryParameterValues = new HashMap<>();
|
||||
HashMap<String, Object> _headerParameterValues = new HashMap<>();
|
||||
String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
|
||||
Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, "application/xml");
|
||||
if (_retVal == null) {
|
||||
return null;
|
||||
}
|
||||
if (_retVal instanceof JAXBElement) {
|
||||
JAXBElement jaxbElement = ((JAXBElement) _retVal);
|
||||
_retVal = jaxbElement.getValue();
|
||||
}
|
||||
return ((com.intellij.jarRepository.services.nexus.Repositories) _retVal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
public class NexusModel {
|
||||
|
||||
public static class RepositorySearchResults{
|
||||
public RepositoryType[] data;
|
||||
}
|
||||
public static class RepositoryType {
|
||||
public String id;
|
||||
public String name;
|
||||
public String provider;
|
||||
public String format;
|
||||
public String exposed;
|
||||
public String contentResourceURI;
|
||||
}
|
||||
|
||||
public static class ArtifactSearchResults {
|
||||
|
||||
public long totalCount;
|
||||
public long from;
|
||||
public int count;
|
||||
public ArtifactType[] data;
|
||||
}
|
||||
|
||||
public static class ArtifactType {
|
||||
|
||||
public String resourceUri;
|
||||
public String groupId;
|
||||
public String artifactId;
|
||||
public String version;
|
||||
public String classifier;
|
||||
public String packaging;
|
||||
public String extension;
|
||||
public String repoId;
|
||||
public String pomLink;
|
||||
public String artifactLink;
|
||||
}
|
||||
}
|
||||
@@ -15,47 +15,47 @@
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.intellij.jarRepository.RemoteRepositoryDescription;
|
||||
import com.intellij.jarRepository.RepositoryArtifactDescription;
|
||||
import com.intellij.jarRepository.services.MavenRepositoryService;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.io.HttpRequests;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.UnmarshalException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Gregory.Shrago
|
||||
*/
|
||||
public class NexusRepositoryService extends MavenRepositoryService {
|
||||
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
@Nullable
|
||||
public static RemoteRepositoryDescription convertRepositoryInfo(@NotNull RepositoryType repo) {
|
||||
final String id = repo.getId();
|
||||
if (id == null) {
|
||||
public static RemoteRepositoryDescription convertRepositoryInfo(@NotNull NexusModel.RepositoryType repo) {
|
||||
if (repo.id == null) {
|
||||
return null;
|
||||
}
|
||||
final String name = repo.getName();
|
||||
if (name == null) {
|
||||
if (repo.name == null) {
|
||||
return null;
|
||||
}
|
||||
final String uri = repo.getContentResourceURI();
|
||||
if (uri == null) {
|
||||
if (repo.contentResourceURI == null) {
|
||||
return null;
|
||||
}
|
||||
return new RemoteRepositoryDescription(id, name, uri);
|
||||
return new RemoteRepositoryDescription(repo.id, repo.name, repo.contentResourceURI);
|
||||
}
|
||||
|
||||
public static RepositoryArtifactDescription convertArtifactInfo(ArtifactType t) {
|
||||
public static RepositoryArtifactDescription convertArtifactInfo(NexusModel.ArtifactType t) {
|
||||
return new RepositoryArtifactDescription(
|
||||
t.getGroupId(), t.getArtifactId(), t.getVersion(), t.getPackaging(), t.getClassifier(), null, t.getRepoId()
|
||||
t.groupId, t.artifactId, t.version, t.packaging, t.classifier, null, t.repoId
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,23 +68,30 @@ public class NexusRepositoryService extends MavenRepositoryService {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<RemoteRepositoryDescription> getRepositories(@NotNull String url) throws IOException {
|
||||
assert !ApplicationManager.getApplication().isDispatchThread();
|
||||
try {
|
||||
final List<RepositoryType> repos = new Endpoint.Repositories(url).getRepolistAsRepositories().getData().getRepositoriesItem();
|
||||
NexusModel.RepositorySearchResults repos = gson.fromJson(
|
||||
HttpRequests.request(toUrl(url, "repositories"))
|
||||
.productNameAsUserAgent()
|
||||
.accept("application/json")
|
||||
.readString(), NexusModel.RepositorySearchResults.class);
|
||||
final List<RemoteRepositoryDescription> result = new SmartList<>();
|
||||
for (RepositoryType repo : repos) {
|
||||
if ("maven2".equals(repo.getProvider())){
|
||||
final RemoteRepositoryDescription desc = convertRepositoryInfo(repo);
|
||||
if (desc != null) {
|
||||
result.add(desc);
|
||||
if (repos.data != null) {
|
||||
for (NexusModel.RepositoryType repo : repos.data) {
|
||||
if ("maven2".equals(repo.provider)) {
|
||||
final RemoteRepositoryDescription desc = convertRepositoryInfo(repo);
|
||||
if (desc != null) {
|
||||
result.add(desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (UnmarshalException e) {
|
||||
catch (JsonSyntaxException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
catch (JAXBException e) {
|
||||
catch (Exception e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
@@ -92,32 +99,43 @@ public class NexusRepositoryService extends MavenRepositoryService {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<RepositoryArtifactDescription> findArtifacts(@NotNull String url, @NotNull RepositoryArtifactDescription template) throws IOException {
|
||||
assert !ApplicationManager.getApplication().isDispatchThread();
|
||||
try {
|
||||
final String packaging = StringUtil.notNullize(template.getPackaging());
|
||||
final String name = StringUtil.join(Arrays.asList(template.getGroupId(), template.getArtifactId(), template.getVersion()), ":");
|
||||
final SearchResults results = new Endpoint.DataIndex(url).getArtifactlistAsSearchResults(
|
||||
name, template.getGroupId(), template.getArtifactId(), template.getVersion(), null, template.getClassNames()
|
||||
);
|
||||
|
||||
NexusModel.ArtifactSearchResults results =
|
||||
gson.fromJson(HttpRequests.request(toUrl(url, "data_index", prepareParameters(template)))
|
||||
.accept("application/json")
|
||||
.readString(), NexusModel.ArtifactSearchResults.class);
|
||||
|
||||
//boolean tooManyResults = results.isTooManyResults();
|
||||
final SearchResults.Data data = results.getData();
|
||||
final ArrayList<RepositoryArtifactDescription> result = new ArrayList<>();
|
||||
if (data != null) {
|
||||
for (ArtifactType each : data.getArtifact()) {
|
||||
if (Comparing.equal(each.packaging, packaging)){
|
||||
if (results.data != null) {
|
||||
for (NexusModel.ArtifactType each : results.data) {
|
||||
if (Comparing.equal(each.packaging, packaging)) {
|
||||
result.add(convertArtifactInfo(each));
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (tooManyResults) {
|
||||
// result.add(null);
|
||||
//}
|
||||
return result;
|
||||
}
|
||||
catch (UnmarshalException e) {
|
||||
catch (JsonSyntaxException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
catch (JAXBException e) {
|
||||
catch (Exception e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String prepareParameters(@NotNull RepositoryArtifactDescription template) {
|
||||
Map<String, String> params = new LinkedHashMap<>();
|
||||
params.put("q", StringUtil.join(Arrays.asList(template.getGroupId(), template.getArtifactId(), template.getVersion()), ":"));
|
||||
params.put("g", template.getGroupId());
|
||||
params.put("a", template.getArtifactId());
|
||||
params.put("v", template.getVersion());
|
||||
params.put("cn", template.getClassNames());
|
||||
|
||||
return mapToParamString(params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import com.intellij.jarRepository.RemoteRepositoryDescription;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the nexus package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: nexus
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Repositories }
|
||||
*/
|
||||
public Repositories createRepositories() {
|
||||
return new Repositories();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link RepositoryMetaData }
|
||||
*/
|
||||
public RepositoryMetaData createRepositoryMetaData() {
|
||||
return new RepositoryMetaData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link SearchResults }
|
||||
*/
|
||||
public SearchResults createSearchResults() {
|
||||
return new SearchResults();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link RemoteRepositoryDescription }
|
||||
*/
|
||||
public RepositoryType createRepositoryType() {
|
||||
return new RepositoryType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link org.jetbrains.idea.maven.model.MavenArtifactInfo }
|
||||
*/
|
||||
public ArtifactType createArtifactType() {
|
||||
return new ArtifactType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Repositories.Data }
|
||||
*/
|
||||
public Repositories.Data createRepositoriesData() {
|
||||
return new Repositories.Data();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link SearchResults.Data }
|
||||
*/
|
||||
public SearchResults.Data createSearchResultsData() {
|
||||
return new SearchResults.Data();
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import com.intellij.jarRepository.RemoteRepositoryDescription;
|
||||
|
||||
import javax.xml.bind.annotation.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="data">
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="repositories-item" type="{}repositoryType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </element>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"data"
|
||||
})
|
||||
@XmlRootElement(name = "repositories")
|
||||
public class Repositories {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected Repositories.Data data;
|
||||
|
||||
/**
|
||||
* Gets the value of the data property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Repositories.Data }
|
||||
*
|
||||
*/
|
||||
public Repositories.Data getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the data property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Repositories.Data }
|
||||
*
|
||||
*/
|
||||
public void setData(Repositories.Data value) {
|
||||
this.data = value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="repositories-item" type="{}repositoryType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"repositoriesItem"
|
||||
})
|
||||
public static class Data {
|
||||
|
||||
@XmlElement(name = "repositories-item")
|
||||
protected List<RepositoryType> repositoriesItem;
|
||||
|
||||
/**
|
||||
* Gets the value of the repositoriesItem property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a {@code set} method for the repositoriesItem property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getRepositoriesItem().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link RemoteRepositoryDescription }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<RepositoryType> getRepositoriesItem() {
|
||||
if (repositoriesItem == null) {
|
||||
repositoriesItem = new ArrayList<>();
|
||||
}
|
||||
return this.repositoriesItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import javax.xml.bind.annotation.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="repoType" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="effectiveLocalStorageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="proxyUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="sizeOnDisk" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="numArtifacts" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"id",
|
||||
"repoType",
|
||||
"effectiveLocalStorageUrl",
|
||||
"proxyUrl",
|
||||
"sizeOnDisk",
|
||||
"numArtifacts"
|
||||
})
|
||||
@XmlRootElement(name = "repositoryMetaData")
|
||||
public class RepositoryMetaData {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected String id;
|
||||
@XmlElement(required = true)
|
||||
protected String repoType;
|
||||
@XmlElement(required = true)
|
||||
protected String effectiveLocalStorageUrl;
|
||||
@XmlElement(required = true)
|
||||
protected String proxyUrl;
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger sizeOnDisk;
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger numArtifacts;
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setId(String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the repoType property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getRepoType() {
|
||||
return repoType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the repoType property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setRepoType(String value) {
|
||||
this.repoType = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the effectiveLocalStorageUrl property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getEffectiveLocalStorageUrl() {
|
||||
return effectiveLocalStorageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the effectiveLocalStorageUrl property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setEffectiveLocalStorageUrl(String value) {
|
||||
this.effectiveLocalStorageUrl = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the proxyUrl property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getProxyUrl() {
|
||||
return proxyUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the proxyUrl property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setProxyUrl(String value) {
|
||||
this.proxyUrl = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the sizeOnDisk property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getSizeOnDisk() {
|
||||
return sizeOnDisk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the sizeOnDisk property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setSizeOnDisk(BigInteger value) {
|
||||
this.sizeOnDisk = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the numArtifacts property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getNumArtifacts() {
|
||||
return numArtifacts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the numArtifacts property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setNumArtifacts(BigInteger value) {
|
||||
this.numArtifacts = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,386 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for repositoryType complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="repositoryType">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="resourceURI" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="contentResourceURI" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="repoType" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="repoPolicy" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="provider" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="providerRole" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="format" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="userManaged" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="exposed" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="effectiveLocalStorageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "repositoryType", propOrder = {
|
||||
"resourceURI",
|
||||
"contentResourceURI",
|
||||
"id",
|
||||
"name",
|
||||
"repoType",
|
||||
"repoPolicy",
|
||||
"provider",
|
||||
"providerRole",
|
||||
"format",
|
||||
"userManaged",
|
||||
"exposed",
|
||||
"effectiveLocalStorageUrl"
|
||||
})
|
||||
public class RepositoryType implements Serializable {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected String resourceURI;
|
||||
@XmlElement(required = true)
|
||||
protected String contentResourceURI;
|
||||
@XmlElement(required = true)
|
||||
protected String id;
|
||||
@XmlElement(required = true)
|
||||
protected String name;
|
||||
@XmlElement(required = true)
|
||||
protected String repoType;
|
||||
@XmlElement(required = true)
|
||||
protected String repoPolicy;
|
||||
@XmlElement(required = true)
|
||||
protected String provider;
|
||||
@XmlElement(required = true)
|
||||
protected String providerRole;
|
||||
@XmlElement(required = true)
|
||||
protected String format;
|
||||
@XmlElement(required = true)
|
||||
protected String userManaged;
|
||||
@XmlElement(required = true)
|
||||
protected String exposed;
|
||||
@XmlElement(required = true)
|
||||
protected String effectiveLocalStorageUrl;
|
||||
|
||||
/**
|
||||
* Gets the value of the resourceURI property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getResourceURI() {
|
||||
return resourceURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the resourceURI property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setResourceURI(String value) {
|
||||
this.resourceURI = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the contentResourceURI property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getContentResourceURI() {
|
||||
return contentResourceURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the contentResourceURI property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setContentResourceURI(String value) {
|
||||
this.contentResourceURI = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setId(String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the repoType property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getRepoType() {
|
||||
return repoType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the repoType property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setRepoType(String value) {
|
||||
this.repoType = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the repoPolicy property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getRepoPolicy() {
|
||||
return repoPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the repoPolicy property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setRepoPolicy(String value) {
|
||||
this.repoPolicy = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the provider property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the provider property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setProvider(String value) {
|
||||
this.provider = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the providerRole property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getProviderRole() {
|
||||
return providerRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the providerRole property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setProviderRole(String value) {
|
||||
this.providerRole = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the format property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the format property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setFormat(String value) {
|
||||
this.format = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the userManaged property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getUserManaged() {
|
||||
return userManaged;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the userManaged property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setUserManaged(String value) {
|
||||
this.userManaged = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the exposed property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getExposed() {
|
||||
return exposed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the exposed property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setExposed(String value) {
|
||||
this.exposed = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the effectiveLocalStorageUrl property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getEffectiveLocalStorageUrl() {
|
||||
return effectiveLocalStorageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the effectiveLocalStorageUrl property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setEffectiveLocalStorageUrl(String value) {
|
||||
this.effectiveLocalStorageUrl = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,250 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import javax.xml.bind.annotation.*;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="totalCount" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="from" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="count" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="tooManyResults" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="data">
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="artifact" type="{}artifactType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </element>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"totalCount",
|
||||
"from",
|
||||
"count",
|
||||
"tooManyResults",
|
||||
"data"
|
||||
})
|
||||
@XmlRootElement(name = "search-result")
|
||||
public class SearchResult {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger totalCount;
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger from;
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger count;
|
||||
protected boolean tooManyResults;
|
||||
@XmlElement(required = true)
|
||||
protected SearchResult.Data data;
|
||||
|
||||
/**
|
||||
* Gets the value of the totalCount property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the totalCount property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setTotalCount(BigInteger value) {
|
||||
this.totalCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the from property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the from property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setFrom(BigInteger value) {
|
||||
this.from = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the count property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the count property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setCount(BigInteger value) {
|
||||
this.count = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the tooManyResults property.
|
||||
*
|
||||
*/
|
||||
public boolean isTooManyResults() {
|
||||
return tooManyResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the tooManyResults property.
|
||||
*
|
||||
*/
|
||||
public void setTooManyResults(boolean value) {
|
||||
this.tooManyResults = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the data property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link SearchResult.Data }
|
||||
*
|
||||
*/
|
||||
public SearchResult.Data getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the data property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link SearchResult.Data }
|
||||
*
|
||||
*/
|
||||
public void setData(SearchResult.Data value) {
|
||||
this.data = value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="artifact" type="{}artifactType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"artifact"
|
||||
})
|
||||
public static class Data {
|
||||
|
||||
protected List<ArtifactType> artifact;
|
||||
|
||||
/**
|
||||
* Gets the value of the artifact property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a {@code set} method for the artifact property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getArtifact().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link org.jetbrains.idea.maven.model.MavenArtifactInfo }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<ArtifactType> getArtifact() {
|
||||
if (artifact == null) {
|
||||
artifact = new ArrayList<>();
|
||||
}
|
||||
return this.artifact;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,249 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.jarRepository.services.nexus;
|
||||
|
||||
import javax.xml.bind.annotation.*;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="totalCount" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="from" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="count" type="{http://www.w3.org/2001/XMLSchema}integer"/>
|
||||
* <element name="tooManyResults" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="data" minOccurs="0">
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="artifact" type="{}artifactType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </element>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"totalCount",
|
||||
"from",
|
||||
"count",
|
||||
"tooManyResults",
|
||||
"data"
|
||||
})
|
||||
@XmlRootElement(name = "search-results")
|
||||
public class SearchResults {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger totalCount;
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger from;
|
||||
@XmlElement(required = true)
|
||||
protected BigInteger count;
|
||||
protected boolean tooManyResults;
|
||||
protected SearchResults.Data data;
|
||||
|
||||
/**
|
||||
* Gets the value of the totalCount property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the totalCount property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setTotalCount(BigInteger value) {
|
||||
this.totalCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the from property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the from property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setFrom(BigInteger value) {
|
||||
this.from = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the count property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public BigInteger getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the count property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link BigInteger }
|
||||
*
|
||||
*/
|
||||
public void setCount(BigInteger value) {
|
||||
this.count = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the tooManyResults property.
|
||||
*
|
||||
*/
|
||||
public boolean isTooManyResults() {
|
||||
return tooManyResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the tooManyResults property.
|
||||
*
|
||||
*/
|
||||
public void setTooManyResults(boolean value) {
|
||||
this.tooManyResults = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the data property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link SearchResults.Data }
|
||||
*
|
||||
*/
|
||||
public SearchResults.Data getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the data property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link SearchResults.Data }
|
||||
*
|
||||
*/
|
||||
public void setData(SearchResults.Data value) {
|
||||
this.data = value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="artifact" type="{}artifactType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"artifact"
|
||||
})
|
||||
public static class Data {
|
||||
|
||||
protected ArrayList<ArtifactType> artifact;
|
||||
|
||||
/**
|
||||
* Gets the value of the artifact property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a {@code set} method for the artifact property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getArtifact().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link org.jetbrains.idea.maven.model.MavenArtifactInfo }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<ArtifactType> getArtifact() {
|
||||
if (artifact == null) {
|
||||
artifact = new ArrayList<>();
|
||||
}
|
||||
return this.artifact;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<wa:application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:wa="http://research.sun.com/wadl/2006/10"
|
||||
xsi:schemaLocation="">
|
||||
<wa:grammars>
|
||||
<wa:include href="nexus.xsd"/>
|
||||
</wa:grammars>
|
||||
<wa:resources base="http://repository.sonatype.org/service/local/">
|
||||
<wa:resource path="repositories">
|
||||
<wa:method name="GET" id="ListRepositories">
|
||||
<wa:request/>
|
||||
<wa:response>
|
||||
<wa:representation href="#RepoList"/>
|
||||
</wa:response>
|
||||
</wa:method>
|
||||
</wa:resource>
|
||||
<wa:resource path="data_index">
|
||||
<wa:method name="GET" id="FindArtifacts">
|
||||
<wa:request>
|
||||
<wa:param name="q" style="query" type="xsd:string"/>
|
||||
<wa:param name="g" style="query" type="xsd:string"/>
|
||||
<wa:param name="a" style="query" type="xsd:string"/>
|
||||
<wa:param name="v" style="query" type="xsd:string"/>
|
||||
<wa:param name="c" style="query" type="xsd:string"/>
|
||||
</wa:request>
|
||||
<wa:response>
|
||||
<wa:representation href="#ArtifactList"/>
|
||||
</wa:response>
|
||||
</wa:method>
|
||||
</wa:resource>
|
||||
<wa:resource path="data_index/{repository}">
|
||||
<wa:param name="repository" style="template" type="xsd:string"/>
|
||||
<wa:method name="GET" id="FindArtifactsIn">
|
||||
<wa:request>
|
||||
<wa:param name="q" style="query" type="xsd:string"/>
|
||||
<wa:param name="g" style="query" type="xsd:string"/>
|
||||
<wa:param name="a" style="query" type="xsd:string"/>
|
||||
<wa:param name="v" style="query" type="xsd:string"/>
|
||||
<wa:param name="c" style="query" type="xsd:string"/>
|
||||
</wa:request>
|
||||
<wa:response>
|
||||
<wa:representation href="#ArtifactList"/>
|
||||
</wa:response>
|
||||
</wa:method>
|
||||
</wa:resource>
|
||||
</wa:resources>
|
||||
<wa:representation mediaType="application/xml" element="repositories" id="RepoList" status="200"/>
|
||||
<wa:representation mediaType="application/xml" element="repositoryMetaData" id="RepoMetaData" status="200"/>
|
||||
<wa:representation mediaType="application/xml" element="search-results" id="ArtifactList" status="200"/>
|
||||
</wa:application>
|
||||
@@ -1,75 +0,0 @@
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<xsd:element name="repositories">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="data" minOccurs="1" maxOccurs="1">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="repositories-item" type="repositoryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="search-results">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="totalCount" minOccurs="1" maxOccurs="1" type="xsd:integer"/>
|
||||
<xsd:element name="from" minOccurs="1" maxOccurs="1" type="xsd:integer"/>
|
||||
<xsd:element name="count" minOccurs="1" maxOccurs="1" type="xsd:integer"/>
|
||||
<xsd:element name="tooManyResults" minOccurs="1" maxOccurs="1" type="xsd:boolean"/>
|
||||
<xsd:element name="data" minOccurs="0" maxOccurs="1">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="artifact" type="artifactType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="repositoryMetaData">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="id" type="xsd:string"/>
|
||||
<xsd:element name="repoType" type="xsd:string"/>
|
||||
<xsd:element name="effectiveLocalStorageUrl" type="xsd:string"/>
|
||||
<xsd:element name="proxyUrl" type="xsd:string"/>
|
||||
<xsd:element name="sizeOnDisk" type="xsd:integer"/>
|
||||
<xsd:element name="numArtifacts" type="xsd:integer"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:complexType name="repositoryType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="resourceURI" type="xsd:string"/>
|
||||
<xsd:element name="contentResourceURI" type="xsd:string"/>
|
||||
<xsd:element name="id" type="xsd:string"/>
|
||||
<xsd:element name="name" type="xsd:string"/>
|
||||
<xsd:element name="repoType" type="xsd:string"/>
|
||||
<xsd:element name="repoPolicy" type="xsd:string"/>
|
||||
<xsd:element name="provider" type="xsd:string"/>
|
||||
<xsd:element name="providerRole" type="xsd:string"/>
|
||||
<xsd:element name="format" type="xsd:string"/>
|
||||
<xsd:element name="userManaged" type="xsd:string"/>
|
||||
<xsd:element name="exposed" type="xsd:string"/>
|
||||
<xsd:element name="effectiveLocalStorageUrl" type="xsd:string"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="artifactType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="resourceUri" type="xsd:string"/>
|
||||
<xsd:element name="groupId" type="xsd:string"/>
|
||||
<xsd:element name="artifactId" type="xsd:string"/>
|
||||
<xsd:element name="version" type="xsd:string"/>
|
||||
<xsd:element name="classifier" type="xsd:string"/>
|
||||
<xsd:element name="packaging" type="xsd:string"/>
|
||||
<xsd:element name="extension" type="xsd:string"/>
|
||||
<xsd:element name="repoId" type="xsd:string"/>
|
||||
<xsd:element name="contextId" type="xsd:string"/>
|
||||
<xsd:element name="pomLink" type="xsd:string"/>
|
||||
<xsd:element name="artifactLink" type="xsd:string"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
@@ -264,9 +264,8 @@ class MavenArtifactsBuilder {
|
||||
//todo: this is a temporary workaround until these libraries are published to Maven repository;
|
||||
// it's unlikely that code which depend on these libraries will be used when running tests so skipping these dependencies shouldn't cause real problems.
|
||||
// 'microba' contains UI elements which are used in few places (IDEA-200834),
|
||||
// 'wadl-core.jar' is used when searching for Maven artifacts only (IDEA-220227),
|
||||
// 'precompiled_jshell-frontend' is used by "JShell Console" action only (IDEA-222381).
|
||||
library.name == "microba" || library.name == "wadl-core" || library.name == "precompiled_jshell-frontend"
|
||||
library.name == "microba" || library.name == "precompiled_jshell-frontend"
|
||||
}
|
||||
|
||||
private static MavenArtifactDependency createArtifactDependencyByLibrary(JpsMavenRepositoryLibraryDescriptor descriptor, DependencyScope scope) {
|
||||
|
||||
Reference in New Issue
Block a user