Skip to content
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 @@ -73,7 +73,7 @@ public final class AsyncHttpClientConfigDefaults {
public static final String AHC_VERSION;

static {
try (InputStream is = AsyncHttpClientConfigDefaults.class.getResourceAsStream("/ahc-version.properties")) {
try (InputStream is = AsyncHttpClientConfigDefaults.class.getResourceAsStream("ahc-version.properties")) {
Properties prop = new Properties();
prop.load(is);
AHC_VERSION = prop.getProperty("ahc.version", "UNKNOWN");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;

Expand Down Expand Up @@ -45,29 +43,7 @@ public void reload() {
private Properties parsePropertiesFile(String file, boolean required) {
Properties props = new Properties();

List<ClassLoader> cls = new ArrayList<>();

ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl != null) {
cls.add(cl);
}
cl = getClass().getClassLoader();
if (cl != null) {
cls.add(cl);
}
cl = ClassLoader.getSystemClassLoader();
if (cl != null) {
cls.add(cl);
}

InputStream is = null;
for (ClassLoader classLoader : cls) {
is = classLoader.getResourceAsStream(file);
if (is != null) {
break;
}
}

InputStream is = getClass().getResourceAsStream(file);
if (is != null) {
try {
props.load(is);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class FileLikePart extends PartBase {
private static final MimetypesFileTypeMap MIME_TYPES_FILE_TYPE_MAP;

static {
try (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("ahc-mime.types")) {
try (InputStream is = FileLikePart.class.getResourceAsStream("ahc-mime.types")) {
MIME_TYPES_FILE_TYPE_MAP = new MimetypesFileTypeMap(is);
} catch (IOException e) {
throw new ExceptionInInitializerError(e);
Expand Down