    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      https://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.io.monitor;
    018import java.io.File;
    019
    020/**
    021 * Receives events of file system modifications.
    022 * <p>
    023 * Register {@link FileAlterationListener}s with a {@link FileAlterationObserver}.
    024 * </p>
    025 *
    026 * @see FileAlterationObserver
    027 * @since 2.0
    028 */
    029public interface FileAlterationListener {
    030
    031    /**
    032     * Directory changed Event.
    033     *
    034     * @param directory The directory changed.
    035     */
    036    void onDirectoryChange(File directory);
    037
    038    /**
    039     * Directory created Event.
    040     *
    041     * @param directory The directory created.
    042     */
    043    void onDirectoryCreate(File directory);
    044
    045    /**
    046     * Directory deleted Event.
    047     *
    048     * @param directory The directory deleted.
    049     */
    050    void onDirectoryDelete(File directory);
    051
    052    /**
    053     * File changed Event.
    054     *
    055     * @param file The file changed.
    056     */
    057    void onFileChange(File file);
    058
    059    /**
    060     * File created Event.
    061     *
    062     * @param file The file created.
    063     */
    064    void onFileCreate(File file);
    065
    066    /**
    067     * File deleted Event.
    068     *
    069     * @param file The file deleted.
    070     */
    071    void onFileDelete(File file);
    072
    073    /**
    074     * File system observer started checking event.
    075     *
    076     * @param observer The file system observer.
    077     */
    078    void onStart(FileAlterationObserver observer);
    079
    080    /**
    081     * File system observer finished checking event.
    082     *
    083     * @param observer The file system observer.
    084     */
    085    void onStop(FileAlterationObserver observer);
    086}