@Test public void testGetMatchingRrds() throws Exception { createMockSineRrds(null); final List<File> matches = m_converter.getMatchingGroupRrds(m_sineFull); assertEquals(1, matches.size()); }
public List<File> getMatchingGroupRrds(final File rrdGroupFile) throws ConverterException { if (rrdGroupFile == null) return Collections.emptyList(); final List<String> dsNames; try { dsNames = getDsNames(rrdGroupFile); } catch (final ConverterException e) { LogUtils.debugf(this, "Unable to get dsNames for %s", rrdGroupFile); return Collections.emptyList(); } final List<File> files = new ArrayList<File>(); for (final File f : rrdGroupFile.getAbsoluteFile().getParentFile().listFiles()) { for (final String dsName : dsNames) { if (f.getName().equals(dsName + ".rrd") || f.getName().equals(dsName + ".jrb")) { files.add(f); } } } return files; }
JRobinConverter { public List<File> getMatchingGroupRrds(final File rrdGroupFile) throws ConverterException { if (rrdGroupFile == null) return Collections.emptyList(); final List<String> dsNames; try { dsNames = getDsNames(rrdGroupFile); } catch (final ConverterException e) { LogUtils.debugf(this, "Unable to get dsNames for %s", rrdGroupFile); return Collections.emptyList(); } final List<File> files = new ArrayList<File>(); for (final File f : rrdGroupFile.getAbsoluteFile().getParentFile().listFiles()) { for (final String dsName : dsNames) { if (f.getName().equals(dsName + ".rrd") || f.getName().equals(dsName + ".jrb")) { files.add(f); } } } return files; } }
JRobinConverter { public List<File> getMatchingGroupRrds(final File rrdGroupFile) throws ConverterException { if (rrdGroupFile == null) return Collections.emptyList(); final List<String> dsNames; try { dsNames = getDsNames(rrdGroupFile); } catch (final ConverterException e) { LogUtils.debugf(this, "Unable to get dsNames for %s", rrdGroupFile); return Collections.emptyList(); } final List<File> files = new ArrayList<File>(); for (final File f : rrdGroupFile.getAbsoluteFile().getParentFile().listFiles()) { for (final String dsName : dsNames) { if (f.getName().equals(dsName + ".rrd") || f.getName().equals(dsName + ".jrb")) { files.add(f); } } } return files; }  }
JRobinConverter { public List<File> getMatchingGroupRrds(final File rrdGroupFile) throws ConverterException { if (rrdGroupFile == null) return Collections.emptyList(); final List<String> dsNames; try { dsNames = getDsNames(rrdGroupFile); } catch (final ConverterException e) { LogUtils.debugf(this, "Unable to get dsNames for %s", rrdGroupFile); return Collections.emptyList(); } final List<File> files = new ArrayList<File>(); for (final File f : rrdGroupFile.getAbsoluteFile().getParentFile().listFiles()) { for (final String dsName : dsNames) { if (f.getName().equals(dsName + ".rrd") || f.getName().equals(dsName + ".jrb")) { files.add(f); } } } return files; }  static void main(final String[] args); void execute(final String[] args); List<File> getMatchingGroupRrds(final File rrdGroupFile); List<String> getDsNames(final File rrdFile); List<String> getRras(final File rrdFile); Map<String, Integer> getDsIndexes(final RrdDb rrd); void consolidateRrdFile(final File groupFile, final File outputFile); List<File> findRrds(final File topDirectory); List<File> findGroupRrds(final File topDirectory); void findRrds(final File directory, final List<File> files); File createTempRrd(final File rrdFile); boolean moveFileSafely(final File in, final File out); }
JRobinConverter { public List<File> getMatchingGroupRrds(final File rrdGroupFile) throws ConverterException { if (rrdGroupFile == null) return Collections.emptyList(); final List<String> dsNames; try { dsNames = getDsNames(rrdGroupFile); } catch (final ConverterException e) { LogUtils.debugf(this, "Unable to get dsNames for %s", rrdGroupFile); return Collections.emptyList(); } final List<File> files = new ArrayList<File>(); for (final File f : rrdGroupFile.getAbsoluteFile().getParentFile().listFiles()) { for (final String dsName : dsNames) { if (f.getName().equals(dsName + ".rrd") || f.getName().equals(dsName + ".jrb")) { files.add(f); } } } return files; }  static void main(final String[] args); void execute(final String[] args); List<File> getMatchingGroupRrds(final File rrdGroupFile); List<String> getDsNames(final File rrdFile); List<String> getRras(final File rrdFile); Map<String, Integer> getDsIndexes(final RrdDb rrd); void consolidateRrdFile(final File groupFile, final File outputFile); List<File> findRrds(final File topDirectory); List<File> findGroupRrds(final File topDirectory); void findRrds(final File directory, final List<File> files); File createTempRrd(final File rrdFile); boolean moveFileSafely(final File in, final File out);  }