1/* 2 * Copyright 2008 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16package org.mockftpserver.fake.filesystem 17 18/** 19 * Exception thrown when a requested operation is not allowed or possible on a directory 20 * or file that should already exist. This type of error typically causes a 550 reply 21 * code from an FTP server. Causes include: 22 * <ul> 23 * <li>The file/directory does not exist</li> 24 * <li>The existing file/directory does not meet some required condition. e.g., trying to remove a non-empty directory</li> 25 * <li>The specified path is expected to be a file, but actually specifies an existing directory, or vice versa</li> 26 * </ul> 27 */ 28class ExistingFileOperationException extends FileSystemException { 29 30 String path 31 32 /** 33 * @param path 34 */ 35 ExistingFileOperationException(String path) { 36 super(msg(path)) 37 this.path = path 38 } 39 40 /** 41 * @param path 42 * @param cause 43 */ 44 ExistingFileOperationException(Throwable cause, String path) { 45 super(msg(path), cause) 46 this.path = path 47 } 48 49 private static String msg(path) { 50 "Error occurred for [$path]" 51 } 52}