class WireFileDistribution {

  public WireFileDistribution(final FileDistribution fileDistribution,
                              ConsoleProperties properties,
                              Timer timer) {

    timer.schedule(new TimerTask() {
        public void run() {
          fileDistribution.scanDistributionFiles();
        }
      },
      properties.getScanDistributionFilesPeriod(),
      properties.getScanDistributionFilesPeriod());


    properties.addPropertyChangeListener(
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
          final String propertyName = e.getPropertyName();

          if (propertyName.equals(
            ConsoleProperties.DISTRIBUTION_DIRECTORY_PROPERTY)) {
            fileDistribution.setDirectory((Directory)e.getNewValue());
          }
          else if (propertyName.equals(
            ConsoleProperties.DISTRIBUTION_FILE_FILTER_EXPRESSION_PROPERTY)) {
            fileDistribution.setFileFilterPattern((Pattern) e.getNewValue());
          }
        }
      });
  }

  public  WireFileDistribution(final FileDistribution fileDistribution,
                              ConsoleProperties properties,
                              Timer timer);

}