Skip to content

Commit

Permalink
move hosted, proxy and group classes into separate packages
Browse files Browse the repository at this point in the history
  • Loading branch information
stklcode committed Aug 14, 2024
1 parent a2816cc commit 72782eb
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.group;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.group;

import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.view.Content;
import org.sonatype.nexus.repository.view.Payload;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.group;

import java.util.List;

Expand All @@ -19,6 +19,7 @@
import javax.inject.Singleton;

import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.view.Content;
import org.sonatype.nexus.repository.view.Payload;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.group;

import java.io.IOException;
import java.time.OffsetDateTime;
Expand All @@ -21,6 +21,7 @@
import javax.inject.Singleton;

import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.view.Content;
import org.sonatype.nexus.repository.view.Payload;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.hosted;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.hosted;

import com.google.common.collect.ImmutableMap;
import org.sonatype.nexus.repository.FacetSupport;
import org.sonatype.nexus.repository.composer.AssetKind;
import org.sonatype.nexus.repository.composer.ComposerContentFacet;
import org.sonatype.nexus.repository.composer.ComposerHostedFacet;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.composer.internal.ComposerPathUtils;
import org.sonatype.nexus.repository.content.fluent.FluentAsset;
import org.sonatype.nexus.repository.content.fluent.FluentComponent;
import org.sonatype.nexus.repository.content.fluent.FluentQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.hosted;

import com.google.common.base.Preconditions;
import com.google.common.io.ByteStreams;
Expand All @@ -22,6 +22,7 @@
import org.sonatype.nexus.repository.composer.ComposerContentFacet;
import org.sonatype.nexus.repository.composer.ComposerFormat;
import org.sonatype.nexus.repository.composer.ComposerHostedFacet;
import org.sonatype.nexus.repository.composer.internal.ComposerContentFacetImpl;
import org.sonatype.nexus.repository.content.fluent.FluentAsset;
import org.sonatype.nexus.repository.http.HttpResponses;
import org.sonatype.nexus.repository.importtask.ImportFileConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.proxy;

import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.http.HttpResponses;
import org.sonatype.nexus.repository.http.HttpStatus;
import org.sonatype.nexus.repository.view.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.proxy;

import javax.annotation.Nonnull;
import javax.inject.Inject;

import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.http.HttpResponses;
import org.sonatype.nexus.repository.http.HttpStatus;
import org.sonatype.nexus.repository.view.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.proxy;

import java.io.IOException;
import java.io.UncheckedIOException;
Expand All @@ -26,6 +26,7 @@
import org.sonatype.nexus.repository.cache.CacheInfo;
import org.sonatype.nexus.repository.composer.AssetKind;
import org.sonatype.nexus.repository.composer.ComposerContentFacet;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.config.Configuration;
import org.sonatype.nexus.repository.content.facet.ContentProxyFacetSupport;
import org.sonatype.nexus.repository.content.fluent.FluentAsset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ package org.sonatype.nexus.repository.composer.internal.recipe

import org.sonatype.nexus.repository.composer.AssetKind
import org.sonatype.nexus.repository.composer.ComposerFormat
import org.sonatype.nexus.repository.composer.internal.ComposerGroupPackageJsonHandler
import org.sonatype.nexus.repository.composer.internal.ComposerGroupPackagesJsonHandler
import org.sonatype.nexus.repository.composer.internal.ComposerGroupProviderJsonHandler
import org.sonatype.nexus.repository.composer.internal.group.ComposerGroupPackageJsonHandler
import org.sonatype.nexus.repository.composer.internal.group.ComposerGroupPackagesJsonHandler
import org.sonatype.nexus.repository.composer.internal.group.ComposerGroupProviderJsonHandler

import javax.annotation.Nonnull
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
package org.sonatype.nexus.repository.composer.internal.recipe

import org.sonatype.nexus.repository.composer.ComposerFormat
import org.sonatype.nexus.repository.composer.internal.ComposerHostedDownloadHandler
import org.sonatype.nexus.repository.composer.internal.hosted.ComposerHostedDownloadHandler
import org.sonatype.nexus.repository.composer.ComposerHostedFacet
import org.sonatype.nexus.repository.composer.internal.ComposerHostedUploadHandler
import org.sonatype.nexus.repository.composer.internal.hosted.ComposerHostedUploadHandler
import org.sonatype.nexus.repository.view.handlers.LastDownloadedHandler

import javax.annotation.Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ package org.sonatype.nexus.repository.composer.internal.recipe

import org.sonatype.nexus.repository.composer.AssetKind
import org.sonatype.nexus.repository.composer.ComposerFormat
import org.sonatype.nexus.repository.composer.internal.ComposerPackageHandler
import org.sonatype.nexus.repository.composer.internal.ComposerProviderHandler
import org.sonatype.nexus.repository.composer.internal.ComposerProxyFacet
import org.sonatype.nexus.repository.composer.internal.proxy.ComposerPackageHandler
import org.sonatype.nexus.repository.composer.internal.proxy.ComposerProviderHandler
import org.sonatype.nexus.repository.composer.internal.proxy.ComposerProxyFacet

import javax.annotation.Nonnull
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.sonatype.goodies.testsupport.TestSupport;
import org.sonatype.nexus.common.collect.AttributesMap;
import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.internal.group.ComposerGroupPackagesJsonHandler;
import org.sonatype.nexus.repository.group.GroupFacet;
import org.sonatype.nexus.repository.view.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.sonatype.goodies.testsupport.TestSupport;
import org.sonatype.nexus.common.collect.AttributesMap;
import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.internal.group.ComposerGroupProviderJsonHandler;
import org.sonatype.nexus.repository.group.GroupFacet;
import org.sonatype.nexus.repository.view.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.AssetKind;
import org.sonatype.nexus.repository.composer.ComposerHostedFacet;
import org.sonatype.nexus.repository.composer.internal.hosted.ComposerHostedDownloadHandler;
import org.sonatype.nexus.repository.view.*;
import org.sonatype.nexus.repository.view.matchers.token.TokenMatcher;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.sonatype.goodies.testsupport.TestSupport;
import org.sonatype.nexus.common.collect.AttributesMap;
import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.internal.proxy.ComposerProviderHandler;
import org.sonatype.nexus.repository.view.Context;
import org.sonatype.nexus.repository.view.Payload;
import org.sonatype.nexus.repository.view.Request;
Expand All @@ -31,7 +32,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static org.sonatype.nexus.repository.composer.internal.ComposerProviderHandler.DO_NOT_REWRITE;
import static org.sonatype.nexus.repository.composer.internal.proxy.ComposerProviderHandler.DO_NOT_REWRITE;
import static org.sonatype.nexus.repository.http.HttpStatus.INTERNAL_SERVER_ERROR;
import static org.sonatype.nexus.repository.http.HttpStatus.OK;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.hosted;

import com.google.common.collect.ImmutableMap;
import org.junit.Before;
Expand All @@ -20,6 +20,7 @@
import org.sonatype.goodies.testsupport.TestSupport;
import org.sonatype.nexus.repository.Repository;
import org.sonatype.nexus.repository.composer.ComposerContentFacet;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.content.fluent.FluentComponent;
import org.sonatype.nexus.repository.content.fluent.FluentComponents;
import org.sonatype.nexus.repository.content.fluent.FluentQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.hosted;

import org.junit.Test;
import org.mockito.ArgumentCaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
package org.sonatype.nexus.repository.composer.internal.proxy;

import com.google.common.collect.ImmutableMap;
import org.junit.Before;
Expand All @@ -22,7 +22,7 @@
import org.sonatype.nexus.repository.cache.CacheInfo;
import org.sonatype.nexus.repository.composer.AssetKind;
import org.sonatype.nexus.repository.composer.ComposerContentFacet;
import org.sonatype.nexus.repository.composer.internal.ComposerProxyFacet.NonResolvableProviderJsonException;
import org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor;
import org.sonatype.nexus.repository.content.fluent.FluentAsset;
import org.sonatype.nexus.repository.view.*;
import org.sonatype.nexus.repository.view.matchers.token.TokenMatcher;
Expand Down Expand Up @@ -305,7 +305,7 @@ public void getUrlZipball() throws Exception {
assertThat(underTest.getUrl(context), is("distUrl"));
}

@Test(expected = NonResolvableProviderJsonException.class)
@Test(expected = ComposerProxyFacet.NonResolvableProviderJsonException.class)
public void getUrlZipballMissingProviderJson() throws Exception {
when(contextAttributes.require(AssetKind.class)).thenReturn(ZIPBALL);
when(contextAttributes.require(TokenMatcher.State.class)).thenReturn(state);
Expand Down

0 comments on commit 72782eb

Please sign in to comment.