Exemple #1
0
 public override IndexOutput CreateOutput(string name, IOContext context)
 {
     if (VERBOSE)
     {
         Console.WriteLine("nrtdir.createOutput name=" + name);
     }
     if (DoCacheWrite(name, context))
     {
         if (VERBOSE)
         {
             Console.WriteLine("  to cache");
         }
         try
         {
             @delegate.DeleteFile(name);
         }
         catch (Exception ioe) when(ioe.IsIOException())
         {
             // this is fine: file may not exist
         }
         return(cache.CreateOutput(name, context));
     }
     else
     {
         try
         {
             cache.DeleteFile(name);
         }
         catch (Exception ioe) when(ioe.IsIOException())
         {
             // this is fine: file may not exist
         }
         return(@delegate.CreateOutput(name, context));
     }
 }
 public override IndexOutput CreateOutput(string name, IOContext context)
 {
     if (VERBOSE)
     {
         Console.WriteLine("nrtdir.createOutput name=" + name);
     }
     if (DoCacheWrite(name, context))
     {
         if (VERBOSE)
         {
             Console.WriteLine("  to cache");
         }
         try
         {
             @delegate.DeleteFile(name);
         }
         catch (IOException) // LUCENENET: IDE0059: Remove unnecessary value assignment
         {
             // this is fine: file may not exist
         }
         return(cache.CreateOutput(name, context));
     }
     else
     {
         try
         {
             cache.DeleteFile(name);
         }
         catch (IOException) // LUCENENET: IDE0059: Remove unnecessary value assignment
         {
             // this is fine: file may not exist
         }
         return(@delegate.CreateOutput(name, context));
     }
 }
        public override IndexOutput CreateOutput(string name, IOContext context)
        {
            if (VERBOSE)
            {
                Console.WriteLine("nrtdir.createOutput name=" + name);
            }
            if (DoCacheWrite(name, context))
            {
                if (VERBOSE)
                {
                    Console.WriteLine("  to cache");
                }
                try
                {
                    @delegate.DeleteFile(name);
                }
#pragma warning disable 168
                catch (IOException ioe)
#pragma warning restore 168
                {
                    // this is fine: file may not exist
                }
                return(cache.CreateOutput(name, context));
            }
            else
            {
                try
                {
                    cache.DeleteFile(name);
                }
#pragma warning disable 168
                catch (IOException ioe)
#pragma warning restore 168
                {
                    // this is fine: file may not exist
                }
                return(@delegate.CreateOutput(name, context));
            }
        }