Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void clearIdFiles(java.nio.file.Path backupLocation) throws java.io.IOException
        internal virtual void ClearIdFiles(Path backupLocation)
        {
            IOException exception       = null;
            File        targetDirectory = backupLocation.toFile();

            File[] files = _fs.listFiles(targetDirectory);
            foreach (File file in files)
            {
                if (!_fs.isDirectory(file) && file.Name.EndsWith(".id"))
                {
                    try
                    {
                        long highId = IdGeneratorImpl.readHighId(_fs, file);
                        _fs.deleteFile(file);
                        IdGeneratorImpl.createGenerator(_fs, file, highId, true);
                    }
                    catch (IOException e)
                    {
                        exception = Exceptions.chain(exception, e);
                    }
                }
            }
            if (exception != null)
            {
                throw exception;
            }
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void ensureStoresHaveIdFiles(org.neo4j.io.layout.DatabaseLayout databaseLayout) throws java.io.IOException
        private void EnsureStoresHaveIdFiles(DatabaseLayout databaseLayout)
        {
            foreach (File idFile in databaseLayout.IdFiles())
            {
                assertTrue("Missing id file " + idFile, idFile.exists());
                assertTrue("Id file " + idFile + " had 0 highId", IdGeneratorImpl.readHighId(_fileSystemRule.get(), idFile) > 0);
            }
        }