1dfb59d50631968ab1a13002ea5421ece93169851chrismair/* 2dfb59d50631968ab1a13002ea5421ece93169851chrismair * Copyright 2008 the original author or authors. 3dfb59d50631968ab1a13002ea5421ece93169851chrismair * 4dfb59d50631968ab1a13002ea5421ece93169851chrismair * Licensed under the Apache License, Version 2.0 (the "License"); 5dfb59d50631968ab1a13002ea5421ece93169851chrismair * you may not use this file except in compliance with the License. 6dfb59d50631968ab1a13002ea5421ece93169851chrismair * You may obtain a copy of the License at 7dfb59d50631968ab1a13002ea5421ece93169851chrismair * 8dfb59d50631968ab1a13002ea5421ece93169851chrismair * http://www.apache.org/licenses/LICENSE-2.0 9dfb59d50631968ab1a13002ea5421ece93169851chrismair * 10dfb59d50631968ab1a13002ea5421ece93169851chrismair * Unless required by applicable law or agreed to in writing, software 11dfb59d50631968ab1a13002ea5421ece93169851chrismair * distributed under the License is distributed on an "AS IS" BASIS, 12dfb59d50631968ab1a13002ea5421ece93169851chrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13dfb59d50631968ab1a13002ea5421ece93169851chrismair * See the License for the specific language governing permissions and 14dfb59d50631968ab1a13002ea5421ece93169851chrismair * limitations under the License. 15dfb59d50631968ab1a13002ea5421ece93169851chrismair */ 16dfb59d50631968ab1a13002ea5421ece93169851chrismairpackage org.mockftpserver.fake.filesystem; 17dfb59d50631968ab1a13002ea5421ece93169851chrismair 18dfb59d50631968ab1a13002ea5421ece93169851chrismairimport org.mockftpserver.core.MockFtpServerException; 19dfb59d50631968ab1a13002ea5421ece93169851chrismair 20dfb59d50631968ab1a13002ea5421ece93169851chrismair/** 21dfb59d50631968ab1a13002ea5421ece93169851chrismair * Represents an error that occurs while performing a FileSystem operation. 22dfb59d50631968ab1a13002ea5421ece93169851chrismair * 23dfb59d50631968ab1a13002ea5421ece93169851chrismair * @author Chris Mair 24dfb59d50631968ab1a13002ea5421ece93169851chrismair * @version $Revision$ - $Date$ 25dfb59d50631968ab1a13002ea5421ece93169851chrismair */ 26dfb59d50631968ab1a13002ea5421ece93169851chrismairpublic class FileSystemException extends MockFtpServerException { 27dfb59d50631968ab1a13002ea5421ece93169851chrismair 28dfb59d50631968ab1a13002ea5421ece93169851chrismair /** 29dfb59d50631968ab1a13002ea5421ece93169851chrismair * The path involved in the file system operation that caused the exception 30dfb59d50631968ab1a13002ea5421ece93169851chrismair */ 31dfb59d50631968ab1a13002ea5421ece93169851chrismair private String path; 32dfb59d50631968ab1a13002ea5421ece93169851chrismair 33dfb59d50631968ab1a13002ea5421ece93169851chrismair /** 34dfb59d50631968ab1a13002ea5421ece93169851chrismair * The message key for the exception message 35dfb59d50631968ab1a13002ea5421ece93169851chrismair */ 36dfb59d50631968ab1a13002ea5421ece93169851chrismair private String messageKey; 37dfb59d50631968ab1a13002ea5421ece93169851chrismair 38dfb59d50631968ab1a13002ea5421ece93169851chrismair /** 39dfb59d50631968ab1a13002ea5421ece93169851chrismair * Construct a new instance for the specified path and message key 40dfb59d50631968ab1a13002ea5421ece93169851chrismair * 41dfb59d50631968ab1a13002ea5421ece93169851chrismair * @param path - the path involved in the file system operation that caused the exception 42dfb59d50631968ab1a13002ea5421ece93169851chrismair * @param messageKey - the exception message key 43dfb59d50631968ab1a13002ea5421ece93169851chrismair */ 44dfb59d50631968ab1a13002ea5421ece93169851chrismair public FileSystemException(String path, String messageKey) { 45dfb59d50631968ab1a13002ea5421ece93169851chrismair super(path); 46dfb59d50631968ab1a13002ea5421ece93169851chrismair this.path = path; 47dfb59d50631968ab1a13002ea5421ece93169851chrismair this.messageKey = messageKey; 48dfb59d50631968ab1a13002ea5421ece93169851chrismair } 49dfb59d50631968ab1a13002ea5421ece93169851chrismair 50dfb59d50631968ab1a13002ea5421ece93169851chrismair /** 51dfb59d50631968ab1a13002ea5421ece93169851chrismair * @param path - the path involved in the file system operation that caused the exception 52dfb59d50631968ab1a13002ea5421ece93169851chrismair * @param messageKey - the exception message key 53dfb59d50631968ab1a13002ea5421ece93169851chrismair * @param cause - the exception cause, wrapped by this exception 54dfb59d50631968ab1a13002ea5421ece93169851chrismair */ 55dfb59d50631968ab1a13002ea5421ece93169851chrismair public FileSystemException(String path, String messageKey, Throwable cause) { 56dfb59d50631968ab1a13002ea5421ece93169851chrismair super(path, cause); 57dfb59d50631968ab1a13002ea5421ece93169851chrismair this.path = path; 58dfb59d50631968ab1a13002ea5421ece93169851chrismair this.messageKey = messageKey; 59dfb59d50631968ab1a13002ea5421ece93169851chrismair } 60dfb59d50631968ab1a13002ea5421ece93169851chrismair 61dfb59d50631968ab1a13002ea5421ece93169851chrismair public String getPath() { 62dfb59d50631968ab1a13002ea5421ece93169851chrismair return path; 63dfb59d50631968ab1a13002ea5421ece93169851chrismair } 64dfb59d50631968ab1a13002ea5421ece93169851chrismair 65dfb59d50631968ab1a13002ea5421ece93169851chrismair public void setPath(String path) { 66dfb59d50631968ab1a13002ea5421ece93169851chrismair this.path = path; 67dfb59d50631968ab1a13002ea5421ece93169851chrismair } 68dfb59d50631968ab1a13002ea5421ece93169851chrismair 69dfb59d50631968ab1a13002ea5421ece93169851chrismair public String getMessageKey() { 70dfb59d50631968ab1a13002ea5421ece93169851chrismair return messageKey; 71dfb59d50631968ab1a13002ea5421ece93169851chrismair } 72dfb59d50631968ab1a13002ea5421ece93169851chrismair 73dfb59d50631968ab1a13002ea5421ece93169851chrismair public void setMessageKey(String messageKey) { 74dfb59d50631968ab1a13002ea5421ece93169851chrismair this.messageKey = messageKey; 75dfb59d50631968ab1a13002ea5421ece93169851chrismair } 76dfb59d50631968ab1a13002ea5421ece93169851chrismair 77dfb59d50631968ab1a13002ea5421ece93169851chrismair} 78