org.sonatype.nexus.repository.rest.api.model.HostedStorageAttributes Java Examples

The following examples show how to use org.sonatype.nexus.repository.rest.api.model.HostedStorageAttributes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ResourceITSupport.java    From nexus-repository-helm with Eclipse Public License 1.0 5 votes vote down vote up
protected AbstractRepositoryApiRequest createProxyRequest(boolean strictContentTypeValidation) {
  HostedStorageAttributes storage =
      new HostedStorageAttributes("default", strictContentTypeValidation, WritePolicy.ALLOW.name());
  CleanupPolicyAttributes cleanup = new CleanupPolicyAttributes(Collections.emptyList());
  ProxyAttributes proxy = new ProxyAttributes("http://example.net", 1, 2);
  NegativeCacheAttributes negativeCache = new NegativeCacheAttributes(false, 1440);
  HttpClientConnectionAttributes connection =
      new HttpClientConnectionAttributes(1, null, 5, false, false);
  HttpClientAttributes httpClient = new HttpClientAttributes(false, true, connection, null);

  // SET YOUR FORMAT DATA
  return new HelmProxyRepositoryApiRequest(PROXY_NAME, true, storage, cleanup,
      proxy, negativeCache,
      httpClient, null);
}
 
Example #2
Source File: ResourceITSupport.java    From nexus-repository-helm with Eclipse Public License 1.0 5 votes vote down vote up
protected AbstractRepositoryApiRequest createHostedRequest(boolean strictContentTypeValidation) {
  HostedStorageAttributes storage =
      new HostedStorageAttributes("default", strictContentTypeValidation, WritePolicy.ALLOW.name());
  CleanupPolicyAttributes cleanup = new CleanupPolicyAttributes(Collections.emptyList());

  // SET YOUR FORMAT DATA
  return new HelmHostedRepositoryApiRequest(HOSTED_NAME, true, storage,
      cleanup);
}
 
Example #3
Source File: HelmHostedRepositoryApiRequest.java    From nexus-repository-helm with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public HelmHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup)
{
  super(name, HelmFormat.NAME, online, storage, cleanup);
}
 
Example #4
Source File: RHostedRepositoryApiRequest.java    From nexus-repository-r with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public RHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup)
{
  super(name, RFormat.NAME, online, storage, cleanup);
}
 
Example #5
Source File: RResourceITSupport.java    From nexus-repository-r with Eclipse Public License 1.0 5 votes vote down vote up
protected AbstractRepositoryApiRequest createHostedRequest(boolean strictContentTypeValidation) {
  HostedStorageAttributes storage =
      new HostedStorageAttributes("default", strictContentTypeValidation, WritePolicy.ALLOW.name());
  CleanupPolicyAttributes cleanup = new CleanupPolicyAttributes(Collections.emptyList());

  return new RHostedRepositoryApiRequest(HOSTED_NAME, true, storage,
      cleanup);
}
 
Example #6
Source File: NpmHostedRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public NpmHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup
)
{
  super(name, NpmFormat.NAME, online, storage, cleanup);
}
 
Example #7
Source File: PypiHostedRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public PypiHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup
)
{
  super(name, PyPiFormat.NAME, online, storage, cleanup);
}
 
Example #8
Source File: RawHostedRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public RawHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup)
{
  super(name, RawFormat.NAME, online, storage, cleanup);
}
 
Example #9
Source File: GolangHostedRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public GolangHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup)
{
  super(name, GolangFormat.NAME, online, storage, cleanup);
}
 
Example #10
Source File: MavenHostedApiRepository.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public MavenHostedApiRepository(
    @JsonProperty("name") final String name,
    @JsonProperty("url") final String url,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup,
    @JsonProperty("maven") final MavenAttributes maven)
{
  super(name, Maven2Format.NAME, url, online, storage, cleanup);
  this.maven = maven;
}
 
Example #11
Source File: MavenHostedRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public MavenHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup,
    @JsonProperty("maven") final MavenAttributes maven
)
{
  super(name, Maven2Format.NAME, online, storage, cleanup);
  this.maven = maven;
}
 
Example #12
Source File: AptHostedApiRepository.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public AptHostedApiRepository(
    @JsonProperty("name") final String name,
    @JsonProperty("url") final String url,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup,
    @JsonProperty("apt") final AptHostedRepositoriesAttributes apt,
    @JsonProperty("aptSigning") final AptSigningRepositoriesAttributes aptSigning)
{
  super(name, AptFormat.NAME, url, online, storage, cleanup);
  this.apt = apt;
  this.aptSigning = aptSigning;
}
 
Example #13
Source File: AptHostedRepositoryApiRequest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@JsonCreator
public AptHostedRepositoryApiRequest(
    @JsonProperty("name") final String name,
    @JsonProperty("online") final Boolean online,
    @JsonProperty("storage") final HostedStorageAttributes storage,
    @JsonProperty("cleanup") final CleanupPolicyAttributes cleanup,
    @JsonProperty("apt") final AptHostedRepositoriesAttributes apt,
    @JsonProperty("aptSigning") final AptSigningRepositoriesAttributes aptSigning)
{
  super(name, AptFormat.NAME, online, storage, cleanup);
  this.apt = apt;
  this.aptSigning = aptSigning;
}
 
Example #14
Source File: SimpleApiRepositoryAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
protected HostedStorageAttributes getHostedStorageAttributes(final Repository repository) {
  NestedAttributesMap configuration = repository.getConfiguration().attributes(ConfigurationConstants.STORAGE);

  String blobStoreName = configuration.get(ConfigurationConstants.BLOB_STORE_NAME, String.class);
  Boolean strictContentTypeValidation =
      configuration.get(ConfigurationConstants.STRICT_CONTENT_TYPE_VALIDATION, Boolean.class, Boolean.TRUE);
  String writePolicy =
      toString(configuration.get(ConfigurationConstants.WRITE_POLICY), ConfigurationConstants.WRITE_POLICY_DEFAULT);

  return new HostedStorageAttributes(blobStoreName, strictContentTypeValidation, writePolicy);
}