Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private java.io.File createNeoStoreFile() throws Exception
        private File CreateNeoStoreFile()
        {
            File neoStoreFile = _backupLayout.metadataStore();

            _fs.create(neoStoreFile).close();
            return(neoStoreFile);
        }
Exemplo n.º 2
0
        private bool DatabaseExistsAndContainsData()
        {
            File metaDataFile = _databaseLayout.metadataStore();

            try
            {
                using (PagedFile pagedFile = _pageCache.map(metaDataFile, _pageCache.pageSize(), StandardOpenOption.READ))
                {
                    // OK so the db probably exists
                }
            }
            catch (IOException)
            {
                // It's OK
                return(false);
            }

            using (NeoStores stores = NewStoreFactory(_databaseLayout).openNeoStores(StoreType.NODE, StoreType.RELATIONSHIP))
            {
                return(stores.NodeStore.HighId > 0 || stores.RelationshipStore.HighId > 0);
            }
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void prepareEmpty23Database() throws java.io.IOException
        private void PrepareEmpty23Database()
        {
            (new TestGraphDatabaseFactory()).newEmbeddedDatabase(_storeDir).shutdown();
            _fileSystem.deleteFile(_nativeLabelIndex);
            MetaDataStore.setRecord(_pageCache, _databaseLayout.metadataStore(), MetaDataStore.Position.STORE_VERSION, versionStringToLong(StandardV2_3.STORE_VERSION));
        }