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 * http://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.camel.component.file.strategy; 018 019import org.apache.camel.component.file.GenericFileEndpoint; 020import org.apache.camel.component.file.GenericFileOperationFailedException; 021import org.apache.camel.component.file.GenericFileOperations; 022 023/** 024 * This is the interface to be implemented when a custom implementation needs to be 025 * provided in case of fileExists=Move is in use while moving any existing file in producer 026 * endpoints. 027 */ 028public interface FileMoveExistingStrategy { 029 030 /** 031 * Moves any existing file due fileExists=Move is in use. 032 * 033 * @param endpoint the given endpoint of the component 034 * @param operations file operations API of the relevant component's API 035 * @return result of the file opeartion can be returned 036 * note that for now, implemetion classes for file component 037 * and ftp components, always returned true. However,if such 038 * a need of direct usage of File API returning true|false, 039 * you can use that return value for implementation's return value. 040 */ 041 boolean moveExistingFile(GenericFileEndpoint endpoint, GenericFileOperations operations, String fileName) throws GenericFileOperationFailedException; 042 043}