1c3ab0d6aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3c3ab0d6aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c3ab0d6aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c3ab0d6aSAndrew Rist  * distributed with this work for additional information
6c3ab0d6aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c3ab0d6aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c3ab0d6aSAndrew Rist  * "License"); you may not use this file except in compliance
9c3ab0d6aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10c3ab0d6aSAndrew Rist  *
11c3ab0d6aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12c3ab0d6aSAndrew Rist  *
13c3ab0d6aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c3ab0d6aSAndrew Rist  * software distributed under the License is distributed on an
15c3ab0d6aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c3ab0d6aSAndrew Rist  * KIND, either express or implied.  See the License for the
17c3ab0d6aSAndrew Rist  * specific language governing permissions and limitations
18c3ab0d6aSAndrew Rist  * under the License.
19c3ab0d6aSAndrew Rist  *
20c3ab0d6aSAndrew Rist  *************************************************************/
21c3ab0d6aSAndrew Rist 
22c3ab0d6aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir // NOTE:
26cdf0e10cSrcweir // This class does not yet exist before 1.8.0.8. When we move our shipped
27cdf0e10cSrcweir // version to 1.8.0.8 or higher, this file here can be removed from CVS.
28cdf0e10cSrcweir 
29cdf0e10cSrcweir package org.hsqldb.lib;
30cdf0e10cSrcweir 
31cdf0e10cSrcweir /** is a RuntimeException which indicates failure during basic IO
32cdf0e10cSrcweir  *  operations in a FileAccess implementation.
33cdf0e10cSrcweir  *
34cdf0e10cSrcweir  * @author frank.schoenheit@sun.com
35cdf0e10cSrcweir  *
36cdf0e10cSrcweir  * @version 1.8.0.8
37cdf0e10cSrcweir  * @since 1.8.0.8
38cdf0e10cSrcweir  */
39cdf0e10cSrcweir public class FileSystemRuntimeException extends java.lang.RuntimeException {
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     public static final int fileAccessRemoveElementFailed = 1;
42cdf0e10cSrcweir     public static final int fileAccessRenameElementFailed = 2;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir     private final int errorCode;
45cdf0e10cSrcweir 
FileSystemRuntimeException(int _errorCode)46cdf0e10cSrcweir     public FileSystemRuntimeException(int _errorCode) {
47cdf0e10cSrcweir         super();
48cdf0e10cSrcweir         errorCode = _errorCode;
49cdf0e10cSrcweir     }
50cdf0e10cSrcweir 
FileSystemRuntimeException(String _message, int _errorCode)51cdf0e10cSrcweir     public FileSystemRuntimeException(String _message, int _errorCode) {
52cdf0e10cSrcweir         super(_message);
53cdf0e10cSrcweir         errorCode = _errorCode;
54cdf0e10cSrcweir     }
55cdf0e10cSrcweir 
FileSystemRuntimeException(String _message, java.lang.Throwable _cause, int _errorCode)56cdf0e10cSrcweir     public FileSystemRuntimeException(String _message, java.lang.Throwable _cause, int _errorCode) {
57cdf0e10cSrcweir         super(_message, _cause);
58cdf0e10cSrcweir         errorCode = _errorCode;
59cdf0e10cSrcweir     }
60cdf0e10cSrcweir 
FileSystemRuntimeException(java.lang.Throwable _cause, int _errorCode)61cdf0e10cSrcweir     public FileSystemRuntimeException(java.lang.Throwable _cause, int _errorCode) {
62cdf0e10cSrcweir         super(_cause);
63cdf0e10cSrcweir         errorCode = _errorCode;
64cdf0e10cSrcweir     }
65cdf0e10cSrcweir 
getErrorCode()66cdf0e10cSrcweir     public final int getErrorCode() {
67cdf0e10cSrcweir         return errorCode;
68cdf0e10cSrcweir     }
69cdf0e10cSrcweir }