예제 #1
0
        public void SetMigrationStatus(Org.Neo4j.Io.fs.FileSystemAbstraction fs, java.io.File stateFile, string info)
        {
            if (fs.FileExists(stateFile))
            {
                try
                {
                    fs.Truncate(stateFile, 0);
                }
                catch (IOException e)
                {
                    throw new Exception(e);
                }
            }

            try
            {
                using (Writer writer = fs.OpenAsWriter(stateFile, StandardCharsets.UTF_8, false))
                {
                    writer.write(name());
                    writer.write('\n');
                    writer.write(info);
                    writer.flush();
                }
            }
            catch (IOException e)
            {
                throw new Exception(e);
            }
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.io.Writer openAsWriter(java.io.File fileName, java.nio.charset.Charset charset, boolean append) throws java.io.IOException
        public override Writer OpenAsWriter(File fileName, Charset charset, bool append)
        {
            return(@delegate.OpenAsWriter(fileName, charset, append));
        }