diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-11-22 16:35:20 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-11-22 16:55:36 +0100 |
commit | 32c5f8d8e44298052e472bddd634a0fb684721f9 (patch) | |
tree | c97639efa5f7122d0f828a9c2cb56b39ed5de700 /infra/minimal-distribution-core/src/main/java | |
parent | ca6abb7ac148362b74d29c062df80d0ad67e723f (diff) |
Cleanup various Sonar warings
Unused code, imports, etc.
Change-Id: Icb19d6a877d5ddbfd85caa86c4e62880e4db3c44
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/minimal-distribution-core/src/main/java')
-rw-r--r-- | infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModuleProvider.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModuleProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModuleProvider.java index a373bf636..643af16d2 100644 --- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModuleProvider.java +++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModuleProvider.java @@ -16,25 +16,14 @@ package io.fd.honeycomb.infra.distro.activation; -import com.google.common.collect.ImmutableList; import com.google.inject.Inject; import com.google.inject.Module; import com.google.inject.Provider; import io.fd.honeycomb.infra.distro.schema.ResourceLoader; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -85,14 +74,6 @@ public class ActiveModuleProvider implements Provider<ActiveModules>, ResourceLo return new ArrayList<>(loadResourceContentsOnPath(relativePath)); } - private static Stream<File> folderToFile(final URI uri) { - final File[] files = new File(uri).listFiles(File::isFile); - - return files != null - ? ImmutableList.copyOf(files).stream() - : Collections.<File>emptyList().stream(); - } - private static boolean filterNonModules(final Class<?> clazz) { final boolean isModule = Module.class.isAssignableFrom(clazz); if (!isModule) { @@ -102,30 +83,6 @@ public class ActiveModuleProvider implements Provider<ActiveModules>, ResourceLo } /** - * Read lines from {@code Path} - */ - private static Stream<String> readLines(final Path path) { - try { - return Files.readAllLines(path).stream(); - } catch (IOException e) { - LOG.error("Unable to read content of {}", path, e); - throw new IllegalStateException("Unable to read content of " + path, e); - } - } - - /** - * Converts {@code URL} to {@code URI} - */ - private static URI toURI(final URL url) { - try { - return url.toURI(); - } catch (URISyntaxException e) { - LOG.error("Unable to convert {} to uri", url); - throw new IllegalStateException("Unable to convert " + url + " to uri", e); - } - } - - /** * Loads class by provided name */ private static Class<? extends Module> moduleNameToClass(final String name, |