diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-22 14:48:04 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-22 14:48:04 -0400 |
| commit | 42f7d379a430aaf2fad169f0170de04072b08b10 (patch) | |
| tree | 5d46b43b2d9272f4e593820ee147b3ae3f0d82b0 /BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java | |
| parent | b65b705c391bb772bc41269bce5243c1cc88969d (diff) | |
Formatting changes
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java b/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java index 8b0d303..bc1b990 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java +++ b/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java @@ -98,27 +98,9 @@ public class FileComponentRepository<E extends IDescribedComponent> } } - private void loadComponent(Function<File, E> componentReader, - Path pth) { - try { - E component = componentReader.apply(pth.toFile()); - - if (component == null) { - throw new NullPointerException( - "Component reader read null component"); - } else if (!components.containsKey(component.getName())) { - components.put(component.getName(), component); - } else { - CLASS_LOGGER.warn("Found a duplicate component.\n" - + "Multiple versions of the same component are not currently supported.\n" - + "The component" + component - + " will not be registered ."); - } - } catch (Exception ex) { - CLASS_LOGGER.warn("Error found reading component from file " - + pth.toString() - + ". This component will not be loaded", ex); - } + @Override + public E getComponentByName(String name) { + return components.get(name); } @Override @@ -141,8 +123,26 @@ public class FileComponentRepository<E extends IDescribedComponent> return "Components read from directory " + sourceDirectory + "."; } - @Override - public E getComponentByName(String name) { - return components.get(name); + private void loadComponent(Function<File, E> componentReader, + Path pth) { + try { + E component = componentReader.apply(pth.toFile()); + + if (component == null) { + throw new NullPointerException( + "Component reader read null component"); + } else if (!components.containsKey(component.getName())) { + components.put(component.getName(), component); + } else { + CLASS_LOGGER.warn("Found a duplicate component.\n" + + "Multiple versions of the same component are not currently supported.\n" + + "The component" + component + + " will not be registered ."); + } + } catch (Exception ex) { + CLASS_LOGGER.warn("Error found reading component from file " + + pth.toString() + + ". This component will not be loaded", ex); + } } }
\ No newline at end of file |
