    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.input;
    018
    019/**
    020 * {@link TailerListener} Adapter.
    021 *
    022 * @since 2.0
    023 */
    024public class TailerListenerAdapter implements TailerListener {
    025
    026    /**
    027     * Constructs a new instance.
    028     */
    029    public TailerListenerAdapter() {
    030        // empty
    031    }
    032
    033    /**
    034     * Called each time the Tailer reaches the end of the file.
    035     *
    036     * <strong>Note:</strong> this is called from the tailer thread.
    037     *
    038     * Note: a future version of commons-io will pull this method up to the TailerListener interface,
    039     * for now clients must subclass this class to use this feature.
    040     *
    041     * @since 2.5
    042     */
    043    public void endOfFileReached() {
    044        // noop
    045    }
    046
    047    /**
    048     * This method is called if the tailed file is not found.
    049     */
    050    @Override
    051    public void fileNotFound() {
    052        // noop
    053    }
    054
    055    /**
    056     * Called if a file rotation is detected.
    057     *
    058     * This method is called before the file is reopened, and fileNotFound may
    059     * be called if the new file has not yet been created.
    060     */
    061    @Override
    062    public void fileRotated() {
    063        // noop
    064    }
    065
    066    /**
    067     * Handles an Exception.
    068     *
    069     * @param ex the exception.
    070     */
    071    @Override
    072    public void handle(final Exception ex) {
    073        // noop
    074    }
    075
    076    /**
    077     * Handles a line from a Tailer.
    078     *
    079     * @param line the line.
    080     */
    081    @Override
    082    public void handle(final String line) {
    083        // noop
    084    }
    085
    086    /**
    087     * The tailer will call this method during construction,
    088     * giving the listener a method of stopping the tailer.
    089     *
    090     * @param tailer the tailer.
    091     */
    092    @Override
    093    public void init(final Tailer tailer) {
    094        // noop
    095    }
    096}