Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRESOLVER-409] More deprecation removal #346

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ public final class DefaultRemoteRepositoryFilterManager implements RemoteReposit

private final Map<String, RemoteRepositoryFilterSource> sources;

/**
* SL enabled ctor.
*
* @deprecated for SL and testing purposes only.
*/
@Deprecated
public DefaultRemoteRepositoryFilterManager() {
this.sources = new HashMap<>();
}

@Inject
public DefaultRemoteRepositoryFilterManager(Map<String, RemoteRepositoryFilterSource> sources) {
this.sources = requireNonNull(sources);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import javax.inject.Inject;
import javax.inject.Named;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.eclipse.aether.RepositorySystemSession;
Expand All @@ -41,25 +39,10 @@
public final class HttpTransporterFactory implements TransporterFactory {
public static final String NAME = "http";

private static Map<String, ChecksumExtractor> getManuallyCreatedExtractors() {
HashMap<String, ChecksumExtractor> map = new HashMap<>();
map.put(Nexus2ChecksumExtractor.NAME, new Nexus2ChecksumExtractor());
map.put(XChecksumChecksumExtractor.NAME, new XChecksumChecksumExtractor());
return Collections.unmodifiableMap(map);
}

private float priority = 5.0f;

private final Map<String, ChecksumExtractor> extractors;

/**
* Ctor for ServiceLocator.
*/
@Deprecated
public HttpTransporterFactory() {
this(getManuallyCreatedExtractors());
}

/**
* Creates an (uninitialized) instance of this transporter factory. <em>Note:</em> In case of manual instantiation
* by clients, the new factory needs to be configured via its various mutators before first use or runtime errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
Expand All @@ -44,9 +46,7 @@
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.slf4j.Logger;
Expand Down Expand Up @@ -484,7 +484,7 @@ static boolean checkBasicAuth(String credentials, String username, String passwo
String method = credentials.substring(0, space);
if ("basic".equalsIgnoreCase(method)) {
credentials = credentials.substring(space + 1);
credentials = B64Code.decode(credentials, StringUtil.__ISO_8859_1);
credentials = new String(Base64.getDecoder().decode(credentials), StandardCharsets.ISO_8859_1);
int i = credentials.indexOf(':');
if (i > 0) {
String user = credentials.substring(0, i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ private void newTransporter(String url) throws Exception {
void setUp(TestInfo testInfo) throws Exception {
System.out.println("=== " + testInfo.getDisplayName() + " ===");
session = TestUtils.newSession();
factory = new HttpTransporterFactory();
HashMap<String, ChecksumExtractor> extractors = new HashMap<>();
extractors.put(XChecksumChecksumExtractor.NAME, new XChecksumChecksumExtractor());
extractors.put(Nexus2ChecksumExtractor.NAME, new Nexus2ChecksumExtractor());
factory = new HttpTransporterFactory(extractors);
repoDir = TestFileUtils.createTempDir();
TestFileUtils.writeString(new File(repoDir, "file.txt"), "test");
TestFileUtils.writeString(new File(repoDir, "dir/file.txt"), "test");
Expand Down
Loading