@Test public void testHandle() throws IOException { ComponentUpload component = new ComponentUpload(); AssetUpload asset = new AssetUpload(); asset.setPayload(payload); component.getAssetUploads().add(asset); UploadResponse uploadResponse = underTest.handle(repository, component); assertThat(uploadResponse.getAssetPaths(), contains("packages/sample/sample-1.2.0-py2.7.egg")); assertThat(uploadResponse.getComponentId().getValue(), is("nuId")); verify(contentPermissionChecker).isPermitted(eq(REPO_NAME), eq(PyPiFormat.NAME), eq(BreadActions.EDIT), captor.capture()); VariableSource source = captor.getValue(); assertThat(source.get("format"), is(Optional.of(PyPiFormat.NAME))); assertThat(source.get("path"), is(Optional.of("packages/sample/1.2.0/sample-1.2.0-py2.7.egg"))); assertThat(source.get("coordinate.name"), is(Optional.of("sample"))); assertThat(source.get("coordinate.version"), is(Optional.of("1.2.0"))); }
@Override public Content handle( final Repository repository, final File content, final String path) throws IOException { if (content.getName().endsWith(".asc")) { return importSignatureFile(content, path, repository); } else { return importPackageFile(content, repository); } }
OrientPyPiUploadHandler extends UploadHandlerSupport { @Override public Content handle( final Repository repository, final File content, final String path) throws IOException { if (content.getName().endsWith(".asc")) { return importSignatureFile(content, path, repository); } else { return importPackageFile(content, repository); } } }
OrientPyPiUploadHandler extends UploadHandlerSupport { @Override public Content handle( final Repository repository, final File content, final String path) throws IOException { if (content.getName().endsWith(".asc")) { return importSignatureFile(content, path, repository); } else { return importPackageFile(content, repository); } } @Inject  OrientPyPiUploadHandler(
      final ContentPermissionChecker contentPermissionChecker,
      @Named("simple") final VariableResolverAdapter variableResolverAdapter,
      final Set<UploadDefinitionExtension> uploadDefinitionExtensions); }
OrientPyPiUploadHandler extends UploadHandlerSupport { @Override public Content handle( final Repository repository, final File content, final String path) throws IOException { if (content.getName().endsWith(".asc")) { return importSignatureFile(content, path, repository); } else { return importPackageFile(content, repository); } } @Inject  OrientPyPiUploadHandler(
      final ContentPermissionChecker contentPermissionChecker,
      @Named("simple") final VariableResolverAdapter variableResolverAdapter,
      final Set<UploadDefinitionExtension> uploadDefinitionExtensions); @Override Content handle(
      final Repository repository, final File content, final String path); @Override UploadResponse handle(final Repository repository, final ComponentUpload upload); @Override UploadDefinition getDefinition(); @Override VariableResolverAdapter getVariableResolverAdapter(); @Override ContentPermissionChecker contentPermissionChecker(); @Override boolean supportsExportImport(); }
OrientPyPiUploadHandler extends UploadHandlerSupport { @Override public Content handle( final Repository repository, final File content, final String path) throws IOException { if (content.getName().endsWith(".asc")) { return importSignatureFile(content, path, repository); } else { return importPackageFile(content, repository); } } @Inject  OrientPyPiUploadHandler(
      final ContentPermissionChecker contentPermissionChecker,
      @Named("simple") final VariableResolverAdapter variableResolverAdapter,
      final Set<UploadDefinitionExtension> uploadDefinitionExtensions); @Override Content handle(
      final Repository repository, final File content, final String path); @Override UploadResponse handle(final Repository repository, final ComponentUpload upload); @Override UploadDefinition getDefinition(); @Override VariableResolverAdapter getVariableResolverAdapter(); @Override ContentPermissionChecker contentPermissionChecker(); @Override boolean supportsExportImport();  }