chrismair | 00dc7bd | 2014-05-11 21:21:28 +0000 | [diff] [blame] | 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 | /** |
| 19 | * Exception thrown when a path/filename is not valid. Causes include: |
| 20 | * <ul> |
| 21 | * <li>The filename contains invalid characters</li> |
| 22 | * <li>The path specifies a new filename, but its parent directory does not exist</li> |
| 23 | * <li>The path is expected to be a file, but actually specifies an existing directory</li> |
| 24 | * </ul> |
| 25 | */ |
| 26 | public class InvalidFilenameException extends FileSystemException { |
| 27 | |
| 28 | private static final String MESSAGE_KEY = "filesystem.pathIsNotValid"; |
| 29 | |
| 30 | /** |
| 31 | * @param path - the path involved in the file system operation that caused the exception |
| 32 | */ |
| 33 | public InvalidFilenameException(String path) { |
| 34 | super(path, MESSAGE_KEY); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @param path - the path involved in the file system operation that caused the exception |
| 39 | * @param cause - the exception cause, wrapped by this exception |
| 40 | */ |
| 41 | public InvalidFilenameException(String path, Throwable cause) { |
| 42 | super(path, MESSAGE_KEY, cause); |
| 43 | } |
| 44 | |
| 45 | } |