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 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 */
26class InvalidFilenameException extends FileSystemException {
27
28     String path
29
30     /**
31      * @param path
32      */
33      InvalidFilenameException(String path) {
34         super(msg(path))
35         this.path = path
36     }
37
38     /**
39      * @param path
40      * @param cause
41      */
42      InvalidFilenameException(Throwable cause, String path) {
43         super(msg(path), cause)
44         this.path = path
45     }
46
47     private static String msg(path) {
48         "The path [$path] is not valid"
49     }
50
51}