Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void isLogFile() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void isLogFile()
        {
            LogFiles logFiles = CreateLogFiles();

            assertFalse(logFiles.IsLogFile(new File("aaa.tx.log")));
            assertTrue(logFiles.IsLogFile(new File("filename.0")));
            assertTrue(logFiles.IsLogFile(new File("filename.17")));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void moveTo(java.io.File source, java.io.File target, org.neo4j.kernel.impl.transaction.log.files.LogFiles logFiles) throws java.io.IOException
        public virtual void MoveTo(File source, File target, LogFiles logFiles)
        {
            _fs.mkdirs(logFiles.LogFilesDirectory());
            foreach (File candidate in _fs.listFiles(source, _fileFilter))
            {
                File destination = logFiles.IsLogFile(candidate) ? logFiles.LogFilesDirectory() : target;
                _fs.moveToDirectory(candidate, destination);
            }

            IEnumerable <FileHandle> fileHandles = AcceptedPageCachedFiles(source).iterator;

            foreach (FileHandle fh in fileHandles)
            {
                fh.Rename(new File(target, fh.RelativeFile.Path), StandardCopyOption.REPLACE_EXISTING);
            }
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void verifyLogFilesWithCustomPathListing(String path) throws java.io.IOException
        private void VerifyLogFilesWithCustomPathListing(string path)
        {
            GraphDatabaseAPI   graphDatabase = ( GraphDatabaseAPI )(new TestGraphDatabaseFactory()).newEmbeddedDatabaseBuilder(TestDirectory.databaseDir("customDb")).setConfig(GraphDatabaseSettings.logical_logs_location, path).newGraphDatabase();
            NeoStoreDataSource dataSource    = graphDatabase.DependencyResolver.resolveDependency(typeof(NeoStoreDataSource));
            LogFiles           logFiles      = graphDatabase.DependencyResolver.resolveDependency(typeof(LogFiles));

            assertTrue(dataSource.ListStoreFiles(true).Any(metadata => metadata.LogFile && logFiles.IsLogFile(metadata.file())));
            assertEquals(Paths.get(path).FileName.ToString(), logFiles.LogFilesDirectory().Name);
            graphDatabase.Shutdown();
        }