maven-resolver git commit: [MRESOLVER-2] Add repository id to TransferResource
Repository: maven-resolver Updated Branches: refs/heads/master 3fc53c052 -> d55d218cf [MRESOLVER-2] Add repository id to TransferResource Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/d55d218c Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/d55d218c Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/d55d218c Branch: refs/heads/master Commit: d55d218cf31e4d3f89e9a9117254f082dcbc5d44 Parents: 3fc53c0 Author: Michael Osipov Authored: Sun Oct 16 20:26:04 2016 +0200 Committer: Michael Osipov Committed: Sun May 7 18:51:35 2017 +0200 -- .../aether/transfer/TransferResource.java | 68 .../aether/transfer/TransferEventTest.java | 2 +- .../basic/BasicRepositoryConnector.java | 2 +- .../impl/DefaultChecksumPolicyProviderTest.java | 2 +- .../internal/impl/FailChecksumPolicyTest.java | 2 +- .../impl/RecordingRepositoryConnector.java | 4 +- .../internal/impl/WarnChecksumPolicyTest.java | 2 +- 7 files changed, 64 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/d55d218c/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java -- diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java index cbe0230..1fecdad 100644 --- a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java @@ -29,6 +29,8 @@ import org.eclipse.aether.RequestTrace; public final class TransferResource { +private final String repositoryId; + private final String repositoryUrl; private final String resourceName; @@ -45,16 +47,48 @@ public final class TransferResource /** * Creates a new transfer resource with the specified properties. - * + * + * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a + * trailing slash will automatically be added if missing. + * @param resourceName The relative path to the resource within the repository, may be {@code null}. A leading slash + * (if any) will be automatically removed. + * @param file The source/target file involved in the transfer, may be {@code null}. + * @param trace The trace information, may be {@code null}. + * + * @deprecated As of 1.1.0, replaced by {@link #TransferResource(java.lang.String, java.lang.String, + * java.lang.String, java.io.File, org.eclipse.aether.RequestTrace)} + */ +@Deprecated +public TransferResource( String repositoryUrl, String resourceName, File file, RequestTrace trace ) +{ +this( null, repositoryUrl, resourceName, file, trace ); +} + +/** + * Creates a new transfer resource with the specified properties. + * + * @param repositoryId The ID of the repository used to transfer the resource, may be {@code null} or empty if unknown. * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a *trailing slash will automatically be added if missing. * @param resourceName The relative path to the resource within the repository, may be {@code null}. A leading slash *(if any) will be automatically removed. * @param file The source/target file involved in the transfer, may be {@code null}. * @param trace The trace information, may be {@code null}. + * + * @since 1.1.0 */ -public TransferResource( String repositoryUrl, String resourceName, File file, RequestTrace trace ) +public TransferResource( String repositoryId, String repositoryUrl, String resourceName, +File file, RequestTrace trace ) { +if ( repositoryId == null || repositoryId.length() <= 0 ) +{ +this.repositoryId = ""; +} +else +{ +this.repositoryId = repositoryId; +} + if ( repositoryUrl == null || repositoryUrl.length() <= 0 ) { this.repositoryUrl = ""; @@ -89,9 +123,21 @@ public final class TransferResource } /** + * The ID of the repository, e.g., "central". + * + * @return The ID of the repository or an empty string if unknown, never {@code null}. + * + * @since 1.1.0 + */ +public String getRepositoryId() +{ +return repositoryId; +} + +/** * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/";. Unless the URL i
[1/2] maven-resolver git commit: [MRESOLVER-2] Add repository id to TransferResource.
Repository: maven-resolver Updated Branches: refs/heads/master 98531efd5 -> d2f5aa54b [MRESOLVER-2] Add repository id to TransferResource. o Updated to restore binary compatibility by re-adding methods removed from the public API marking them @Deprecated. Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/077281a8 Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/077281a8 Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/077281a8 Branch: refs/heads/master Commit: 077281a887a47c3aa889e84a8a7a7e9f9585a1b7 Parents: 98531ef Author: Christian Schulte Authored: Mon Dec 12 23:26:22 2016 +0100 Committer: Christian Schulte Committed: Mon Dec 12 23:52:53 2016 +0100 -- .../aether/transfer/TransferResource.java | 23 1 file changed, 23 insertions(+) -- http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/077281a8/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java -- diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java index f2e2135..d304199 100644 --- a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java @@ -48,6 +48,25 @@ public final class TransferResource /** * Creates a new transfer resource with the specified properties. * + * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a + * trailing slash will automatically be added if missing. + * @param resourceName The relative path to the resource within the repository, may be {@code null}. A leading slash + * (if any) will be automatically removed. + * @param file The source/target file involved in the transfer, may be {@code null}. + * @param trace The trace information, may be {@code null}. + * + * @deprecated As of 1.2.0, replaced by {@link #TransferResource(java.lang.String, java.lang.String, + * java.lang.String, java.io.File, org.eclipse.aether.RequestTrace)} + */ +@Deprecated +public TransferResource( String repositoryUrl, String resourceName, File file, RequestTrace trace ) +{ +this( null, repositoryUrl, resourceName, file, trace ); +} + +/** + * Creates a new transfer resource with the specified properties. + * * @param repositoryId The ID of the repository used to transfer the resource, may be {@code null} or empty if unknown. * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a *trailing slash will automatically be added if missing. @@ -55,6 +74,8 @@ public final class TransferResource *(if any) will be automatically removed. * @param file The source/target file involved in the transfer, may be {@code null}. * @param trace The trace information, may be {@code null}. + * + * @since 1.2.0 */ public TransferResource( String repositoryId, String repositoryUrl, String resourceName, File file, RequestTrace trace ) @@ -105,6 +126,8 @@ public final class TransferResource * The ID of the repository, e.g., "central". * * @return The ID of the repository or an empty string if unknown, never {@code null}. + * + * @since 1.2.0 */ public String getRepositoryId() {
maven-resolver git commit: [MRESOLVER-2] Add repository id to TransferResource
Repository: maven-resolver Updated Branches: refs/heads/master 534d71762 -> 11b359e18 [MRESOLVER-2] Add repository id to TransferResource Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/11b359e1 Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/11b359e1 Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/11b359e1 Branch: refs/heads/master Commit: 11b359e188f3b1d25bb6bda60195e7a47ca45bfc Parents: 534d717 Author: Michael Osipov Authored: Sun Oct 16 20:26:04 2016 +0200 Committer: Michael Osipov Committed: Sun Oct 16 20:26:04 2016 +0200 -- .../aether/transfer/TransferResource.java | 45 +++- .../aether/transfer/TransferEventTest.java | 2 +- .../basic/BasicRepositoryConnector.java | 2 +- .../impl/DefaultChecksumPolicyProviderTest.java | 2 +- .../internal/impl/FailChecksumPolicyTest.java | 2 +- .../impl/RecordingRepositoryConnector.java | 4 +- .../internal/impl/WarnChecksumPolicyTest.java | 2 +- 7 files changed, 41 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/11b359e1/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java -- diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java index cbe0230..3395f38 100644 --- a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java @@ -29,6 +29,8 @@ import org.eclipse.aether.RequestTrace; public final class TransferResource { +private final String repositoryId; + private final String repositoryUrl; private final String resourceName; @@ -45,7 +47,8 @@ public final class TransferResource /** * Creates a new transfer resource with the specified properties. - * + * + * @param repositoryId The ID of the repository used to transfer the resource, may be {@code null} or empty if unknown. * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a *trailing slash will automatically be added if missing. * @param resourceName The relative path to the resource within the repository, may be {@code null}. A leading slash @@ -53,8 +56,18 @@ public final class TransferResource * @param file The source/target file involved in the transfer, may be {@code null}. * @param trace The trace information, may be {@code null}. */ -public TransferResource( String repositoryUrl, String resourceName, File file, RequestTrace trace ) +public TransferResource( String repositoryId, String repositoryUrl, String resourceName, +File file, RequestTrace trace ) { +if ( repositoryId == null || repositoryId.length() <= 0 ) +{ +this.repositoryId = ""; +} +else +{ +this.repositoryId = repositoryId; +} + if ( repositoryUrl == null || repositoryUrl.length() <= 0 ) { this.repositoryUrl = ""; @@ -89,9 +102,19 @@ public final class TransferResource } /** + * The ID of the repository, e.g., "central". + * + * @return The ID of the repository or an empty string if unknown, never {@code null}. + */ +public String getRepositoryId() +{ +return repositoryId; +} + +/** * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/";. Unless the URL is unknown, it will be * terminated by a trailing slash. - * + * * @return The base URL of the repository or an empty string if unknown, never {@code null}. */ public String getRepositoryUrl() @@ -101,7 +124,7 @@ public final class TransferResource /** * The path of the resource relative to the repository's base URL, e.g. "org/apache/maven/maven/3.0/maven-3.0.pom". - * + * * @return The path of the resource, never {@code null}. */ public String getResourceName() @@ -112,7 +135,7 @@ public final class TransferResource /** * Gets the local file being uploaded or downloaded. When the repository system merely checks for the existence of a * remote resource, no local file will be involved in the transfer. - * + * * @return The source/target file involved in the transfer or {@code null} if none. */ public File getFile() @@ -124,7 +147,7 @@ public final class TransferResource * The size of the resource in bytes. Note that the size o