Пример #1
0
 private static Org.Neo4j.Helpers.Collection.Pair <string, string> ReadFromFile(Org.Neo4j.Io.fs.FileSystemAbstraction fs, java.io.File file, MigrationStatus expectedSate)
 {
     try
     {
         using (StreamReader reader = new StreamReader(fs.OpenAsReader(file, StandardCharsets.UTF_8)))
         {
             string state = reader.ReadLine().Trim();
             if (expectedSate != null && !expectedSate.name().Equals(state))
             {
                 throw new System.InvalidOperationException("Not in the expected state, expected=" + expectedSate.name() + ", actual=" + state);
             }
             string info = reader.ReadLine().Trim();
             return(Pair.of(state, info));
         }
     }
     catch (FileNotFoundException)
     {
         return(null);
     }
     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.Reader openAsReader(java.io.File fileName, java.nio.charset.Charset charset) throws java.io.IOException
        public override Reader OpenAsReader(File fileName, Charset charset)
        {
            return(@delegate.OpenAsReader(fileName, charset));
        }