org.sonatype.nexus.repository.rest.UploadDefinitionExtension Java Examples

The following examples show how to use org.sonatype.nexus.repository.rest.UploadDefinitionExtension. 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: MavenUploadHandler.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public MavenUploadHandler(
    final Maven2MavenPathParser parser,
    @Named(Maven2Format.NAME) final VariableResolverAdapter variableResolverAdapter,
    final ContentPermissionChecker contentPermissionChecker,
    final VersionPolicyValidator versionPolicyValidator,
    final MavenPomGenerator mavenPomGenerator,
    final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.parser = parser;
  this.variableResolverAdapter = variableResolverAdapter;
  this.contentPermissionChecker = contentPermissionChecker;
  this.versionPolicyValidator = versionPolicyValidator;
  this.mavenPomGenerator = mavenPomGenerator;
}
 
Example #2
Source File: RawUploadHandler.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RawUploadHandler(final ContentPermissionChecker contentPermissionChecker,
                        @Named("simple") final VariableResolverAdapter variableResolverAdapter,
                        final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(contentPermissionChecker, variableResolverAdapter, uploadDefinitionExtensions);
}
 
Example #3
Source File: UploadHandlerSupport.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Provides a mechanism for subclasses to generate an UploadDefinition that allows for
 * extension point contributions.
 *
 * Order of the UploadFieldDefinitions is important as it affects the presentation in the ui.
 */
public UploadDefinition getDefinition(final String format,
                                      final boolean multipleUpload,
                                      final List<UploadFieldDefinition> componentFields,
                                      final List<UploadFieldDefinition> assetFields,
                                      final UploadRegexMap regexMap)
{

  //Gather the existing and contributed field definitions
  List<UploadFieldDefinition> componentFieldDefinitions = concat(
      componentFields.stream(),
      uploadDefinitionExtensions.stream().map(UploadDefinitionExtension::contribute)).collect(toList());

  return new UploadDefinition(format, multipleUpload, componentFieldDefinitions, assetFields, regexMap);
}
 
Example #4
Source File: AptUploadHandler.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public AptUploadHandler(@Named("simple") final VariableResolverAdapter variableResolverAdapter,
                        final ContentPermissionChecker contentPermissionChecker,
                        final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.variableResolverAdapter = variableResolverAdapter;
  this.contentPermissionChecker = contentPermissionChecker;
}
 
Example #5
Source File: RawUploadHandlerTest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected UploadHandler newRawUploadHandler(final ContentPermissionChecker contentPermissionChecker,
                                            final VariableResolverAdapter variableResolverAdapter,
                                            final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  return new RawUploadHandler(contentPermissionChecker, variableResolverAdapter, uploadDefinitionExtensions);
}
 
Example #6
Source File: RawUploadHandlerTest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected UploadHandler newRawUploadHandler(final ContentPermissionChecker contentPermissionChecker,
                                            final VariableResolverAdapter variableResolverAdapter,
                                            final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  return new RawUploadHandler(contentPermissionChecker, variableResolverAdapter, uploadDefinitionExtensions);
}
 
Example #7
Source File: HelmUploadHandler.java    From nexus-repository-helm with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public HelmUploadHandler(
    final ContentPermissionChecker contentPermissionChecker,
    final HelmAttributeParser helmPackageParser,
    @Named("simple") final VariableResolverAdapter variableResolverAdapter,
    final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.contentPermissionChecker = contentPermissionChecker;
  this.variableResolverAdapter = variableResolverAdapter;
  this.helmPackageParser = helmPackageParser;
}
 
Example #8
Source File: RawUploadHandlerSupport.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public RawUploadHandlerSupport(
    final ContentPermissionChecker contentPermissionChecker,
    final VariableResolverAdapter variableResolverAdapter,
    final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.contentPermissionChecker = contentPermissionChecker;
  this.variableResolverAdapter = variableResolverAdapter;
}
 
Example #9
Source File: RawUploadHandler.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RawUploadHandler(final ContentPermissionChecker contentPermissionChecker,
                        @Named("simple") final VariableResolverAdapter variableResolverAdapter,
                        final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(contentPermissionChecker, variableResolverAdapter, uploadDefinitionExtensions);
}
 
Example #10
Source File: OrientPyPiUploadHandler.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public OrientPyPiUploadHandler(final ContentPermissionChecker contentPermissionChecker,
                               @Named("simple") final VariableResolverAdapter variableResolverAdapter,
                               final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.contentPermissionChecker = contentPermissionChecker;
  this.variableResolverAdapter = variableResolverAdapter;
}
 
Example #11
Source File: OrientNpmUploadHandler.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public OrientNpmUploadHandler(final ContentPermissionChecker contentPermissionChecker,
                              @Named("simple") final VariableResolverAdapter variableResolverAdapter,
                              final NpmPackageParser npmPackageParser,
                              final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.contentPermissionChecker = contentPermissionChecker;
  this.variableResolverAdapter = checkNotNull(variableResolverAdapter);
  this.npmPackageParser = checkNotNull(npmPackageParser);
}
 
Example #12
Source File: AptUploadHandler.java    From nexus-repository-apt with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public AptUploadHandler(@Named("simple") final VariableResolverAdapter variableResolverAdapter,
                        final ContentPermissionChecker contentPermissionChecker,
                        final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.variableResolverAdapter = variableResolverAdapter;
  this.contentPermissionChecker = contentPermissionChecker;
}
 
Example #13
Source File: RUploadHandler.java    From nexus-repository-r with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RUploadHandler(@Named("simple") final VariableResolverAdapter variableResolverAdapter,
                      final ContentPermissionChecker contentPermissionChecker,
                      final Set<UploadDefinitionExtension> uploadDefinitionExtensions)
{
  super(uploadDefinitionExtensions);
  this.variableResolverAdapter = variableResolverAdapter;
  this.contentPermissionChecker = contentPermissionChecker;
}
 
Example #14
Source File: OrientPyPiUploadHandlerTest.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
private Set<UploadDefinitionExtension> getDefinitionExtensions() {
  return singleton(new TestUploadDefinitionExtension());
}
 
Example #15
Source File: RawUploadHandlerTestSupport.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
protected abstract UploadHandler newRawUploadHandler(ContentPermissionChecker contentPermissionChecker,
VariableResolverAdapter variableResolverAdapter,
Set<UploadDefinitionExtension> uploadDefinitionExtensions);
 
Example #16
Source File: RawUploadHandlerTestSupport.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
protected Set<UploadDefinitionExtension> getDefinitionExtensions() {
  return singleton(new TestUploadDefinitionExtension());
}
 
Example #17
Source File: OrientNpmUploadHandlerTest.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
private Set<UploadDefinitionExtension> getDefinitionExtensions() {
  return singleton(new TestUploadDefinitionExtension());
}
 
Example #18
Source File: MavenUploadHandlerTest.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
private Set<UploadDefinitionExtension> getDefinitionExtensions() {
  return singleton(new TestUploadDefinitionExtension());
}
 
Example #19
Source File: UploadHandlerSupport.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
public UploadHandlerSupport(final Set<UploadDefinitionExtension> uploadDefinitionExtensions) {
  this.uploadDefinitionExtensions = checkNotNull(uploadDefinitionExtensions);
}