Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / derby-10.3.2.1 / java / engine / org / apache / derby / impl / io / DirRandomAccessFile.java
diff --git a/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java b/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/impl/io/DirRandomAccessFile.java
new file mode 100644 (file)
index 0000000..2a8c892
--- /dev/null
@@ -0,0 +1,74 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.impl.io.DirRandomAccessFile\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.impl.io;\r
+\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+\r
+import org.apache.derby.io.StorageFile;\r
+import org.apache.derby.io.StorageRandomAccessFile;\r
+\r
+import java.io.File;\r
+import java.io.RandomAccessFile;\r
+import java.io.IOException;\r
+import java.io.FileNotFoundException;\r
+\r
+/**\r
+ * This class provides a disk based implementation of the StIRandomAccess File interface. It is used by the\r
+ * database engine to access persistent data and transaction logs under the directory (default) subsubprotocol.\r
+ */\r
+class DirRandomAccessFile extends RandomAccessFile implements StorageRandomAccessFile\r
+{\r
+\r
+    /**\r
+     * Construct a StorageRandomAccessFileImpl.\r
+     *\r
+     * @param name The file name.\r
+     * @param mode The file open mode: "r", "rw", "rws", or "rwd". The  "rws" and "rwd" modes specify that the file is to\r
+     *             be synchronized, consistent with the java.io.RandomAccessFile class. However the\r
+     *             StorageRandomAccessFile.sync() method will be called even if the file was opened\r
+     *             in "rws" or "rwd" mode.  If the "rws" or "rwd" modes are supported then the implementation\r
+     *             of StorageRandomAccessFile.sync need not do anything.\r
+     *\r
+     * @exception IllegalArgumentException if the mode argument is not equal to one of "r", "rw".\r
+     * @exception FileNotFoundException if the file exists but is a directory rather than a regular\r
+     *              file, or cannot be opened or created for any other reason .\r
+     */\r
+    DirRandomAccessFile( File name, String mode) throws FileNotFoundException\r
+    {\r
+        super( name, mode);\r
+    }\r
+\r
+    /**\r
+     * Force any changes out to the persistent store.\r
+     *\r
+     * @param metaData If true then this method is required to force changes to both the file's\r
+     *          content and metadata to be written to storage; otherwise, it need only force content changes\r
+     *          to be written.\r
+     *\r
+     * @exception IOException If an IO error occurs.\r
+     */\r
+    public void sync( boolean metaData) throws IOException\r
+    {\r
+        getFD().sync();\r
+    }\r
+}\r
+    \r