FileAlterationListenerAdaptor.java

  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * The ASF licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *      https://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.apache.commons.io.monitor;

  18. import java.io.File;

  19. /**
  20.  * Convenience {@link FileAlterationListener} implementation that does nothing.
  21.  *
  22.  * @see FileAlterationObserver
  23.  * @since 2.0
  24.  */
  25. public class FileAlterationListenerAdaptor implements FileAlterationListener {

  26.     /**
  27.      * Construct a new instance.
  28.      */
  29.     public FileAlterationListenerAdaptor() {
  30.         // empty
  31.     }

  32.     /**
  33.      * Directory changed Event.
  34.      *
  35.      * @param directory The directory changed (ignored)
  36.      */
  37.     @Override
  38.     public void onDirectoryChange(final File directory) {
  39.         // noop
  40.     }

  41.     /**
  42.      * Directory created Event.
  43.      *
  44.      * @param directory The directory created (ignored)
  45.      */
  46.     @Override
  47.     public void onDirectoryCreate(final File directory) {
  48.         // noop
  49.     }

  50.     /**
  51.      * Directory deleted Event.
  52.      *
  53.      * @param directory The directory deleted (ignored)
  54.      */
  55.     @Override
  56.     public void onDirectoryDelete(final File directory) {
  57.         // noop
  58.     }

  59.     /**
  60.      * File changed Event.
  61.      *
  62.      * @param file The file changed (ignored)
  63.      */
  64.     @Override
  65.     public void onFileChange(final File file) {
  66.         // noop
  67.     }

  68.     /**
  69.      * File created Event.
  70.      *
  71.      * @param file The file created (ignored)
  72.      */
  73.     @Override
  74.     public void onFileCreate(final File file) {
  75.         // noop
  76.     }

  77.     /**
  78.      * File deleted Event.
  79.      *
  80.      * @param file The file deleted (ignored)
  81.      */
  82.     @Override
  83.     public void onFileDelete(final File file) {
  84.         // noop
  85.     }

  86.     /**
  87.      * File system observer started checking event.
  88.      *
  89.      * @param observer The file system observer (ignored)
  90.      */
  91.     @Override
  92.     public void onStart(final FileAlterationObserver observer) {
  93.         // noop
  94.     }

  95.     /**
  96.      * File system observer finished checking event.
  97.      *
  98.      * @param observer The file system observer (ignored)
  99.      */
  100.     @Override
  101.     public void onStop(final FileAlterationObserver observer) {
  102.         // noop
  103.     }

  104. }