Package org.apache.derby.impl.io.vfmem

Examples of org.apache.derby.impl.io.vfmem.VirtualFile


     * Verify that the close() method of VirtualRandomAccessFile can be
     * called more than once.
     */
    public void testCloseIdempotent() throws IOException {
        DataStore store = getStore();
        VirtualFile f = new VirtualFile("afile", store);
        StorageRandomAccessFile raf = f.getRandomAccessFile("rw");
        raf.close();
        // The second close() used to throw NullPointerException (DERBY-5960)
        raf.close();
    }
View Full Code Here


                        this.dbData = DUMMY_STORE;
                    }
                }
            }
            // Specify the data directory and the temp directory.
            dataDirectory = new VirtualFile(canonicalName, dbData);
            tempDir = new VirtualFile(normalizePath(canonicalName, "tmp"),
                                      dbData);

        // Handle cases where the database name is null, but a system home
        // directory has been specified.
        } else if (home != null) {
            // Return the "system home directory" and specify a temporary
            // directory for it (may never by used).
            // As databases are created, the dummy will contain the
            // directory names of the database locations, but the
            // databases themselves will be stored in separate stores.
            final String absHome = new File(home).getCanonicalPath();
            dbData = DUMMY_STORE;
            dataDirectory = new VirtualFile(absHome, dbData);
            tempDir = new VirtualFile(getSeparator() + "tmp", dbData);
        }

        // Create the temporary directory, if one has been specified.
        // Creating the temporary directory too early casues the
        // BaseDataFileFactory to fail, hence the check for uniqueName.
View Full Code Here

        // files are stored.
        if (path == null) {
            // Return the database directory as described by StorageFactory.
            return dataDirectory;
        }
        return new VirtualFile(normalizePath(path), dbData);
    }
View Full Code Here

     * @param directoryName the name of the parent directory
     * @param fileName the name of the file
     * @return A path handle.
     */
    public StorageFile newStorageFile(String directoryName, String fileName) {
            return new VirtualFile(
                                normalizePath(directoryName, fileName), dbData);
    }
View Full Code Here

                        this.dbData = DUMMY_STORE;
                    }
                }
            }
            // Specify the data directory and the temp directory.
            dataDirectory = new VirtualFile(canonicalName, dbData);
            tempDir = new VirtualFile(normalizePath(canonicalName, "tmp"),
                                      dbData);

        // Handle cases where the database name is null, but a system home
        // directory has been specified.
        } else if (home != null) {
            // Return the "system home directory" and specify a temporary
            // directory for it (may never by used).
            // As databases are created, the dummy will contain the
            // directory names of the database locations, but the
            // databases themselves will be stored in separate stores.
            final String absHome = new File(home).getCanonicalPath();
            dbData = DUMMY_STORE;
            dataDirectory = new VirtualFile(absHome, dbData);
            tempDir = new VirtualFile(getSeparator() + "tmp", dbData);
        }

        // Create the temporary directory, if one has been specified.
        // Creating the temporary directory too early casues the
        // BaseDataFileFactory to fail, hence the check for uniqueName.
View Full Code Here

        // files are stored.
        if (path == null) {
            // Return the database directory as described by StorageFactory.
            return dataDirectory;
        }
        return new VirtualFile(normalizePath(path), dbData);
    }
View Full Code Here

     * @param directoryName the name of the parent directory
     * @param fileName the name of the file
     * @return A path handle.
     */
    public StorageFile newStorageFile(String directoryName, String fileName) {
            return new VirtualFile(
                                normalizePath(directoryName, fileName), dbData);
    }
View Full Code Here

        super(name);
    }

    public void testCreateFileInRoot() {
        DataStore store = getStore();
        VirtualFile vFile = new VirtualFile("service.properties", store);
        assertFalse(new VirtualFile("service.properties", store).exists());
        assertFalse(vFile.exists());
    }
View Full Code Here

        assertFalse(vFile.exists());
    }

    public void testCreateDirInRoot() {
        DataStore store = getStore();
        VirtualFile vFile = new VirtualFile("seg0", store);
        assertFalse(vFile.exists());
        vFile.mkdir();
        assertTrue(vFile.exists());
        assertTrue(vFile.isDirectory());
    }
View Full Code Here

        assertTrue(vFile.isDirectory());
    }

    public void testCreateInvalidDir() {
        DataStore store = getStore();
        VirtualFile vFile = new VirtualFile(
                PathUtilTest.join(NON_EXISTING_DIRS),
                store);
        assertFalse(vFile.exists());
        VirtualFile tmp = new VirtualFile("", store);
        assertTrue(tmp.mkdir());
        assertFalse("Dir creation should have failed", vFile.mkdir());
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.impl.io.vfmem.VirtualFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.