Home | History | Annotate | Download | only in filesystem
      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  */
     16 package org.mockftpserver.fake.filesystem;
     17 
     18 import org.mockftpserver.core.MockFtpServerException;
     19 
     20 /**
     21  * Represents an error that occurs while performing a FileSystem operation.
     22  *
     23  * @author Chris Mair
     24  * @version $Revision$ - $Date$
     25  */
     26 public class FileSystemException extends MockFtpServerException {
     27 
     28     /**
     29      * The path involved in the file system operation that caused the exception
     30      */
     31     private String path;
     32 
     33     /**
     34      * The message key for the exception message
     35      */
     36     private String messageKey;
     37 
     38     /**
     39      * Construct a new instance for the specified path and message key
     40      *
     41      * @param path       - the path involved in the file system operation that caused the exception
     42      * @param messageKey - the exception message key
     43      */
     44     public FileSystemException(String path, String messageKey) {
     45         super(path);
     46         this.path = path;
     47         this.messageKey = messageKey;
     48     }
     49 
     50     /**
     51      * @param path       - the path involved in the file system operation that caused the exception
     52      * @param messageKey - the exception message key
     53      * @param cause      - the exception cause, wrapped by this exception
     54      */
     55     public FileSystemException(String path, String messageKey, Throwable cause) {
     56         super(path, cause);
     57         this.path = path;
     58         this.messageKey = messageKey;
     59     }
     60 
     61     public String getPath() {
     62         return path;
     63     }
     64 
     65     public void setPath(String path) {
     66         this.path = path;
     67     }
     68 
     69     public String getMessageKey() {
     70         return messageKey;
     71     }
     72 
     73     public void setMessageKey(String messageKey) {
     74         this.messageKey = messageKey;
     75     }
     76 
     77 }
     78