mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Ludovic Poitou
29.22.2016 09841d36e89fd0e52c949643c893e9e7bc891c6e
opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java
@@ -143,13 +143,6 @@
   * to be removed.
   *
   * @param  args  The command-line arguments provided to this program.
   * @param  out         The output stream to use for standard output, or
   *                           <CODE>null</CODE> if standard output is not
   *                           needed.
   * @param  err         The output stream to use for standard error, or
   *                           <CODE>null</CODE> if standard error is not
   *                           needed.
   * @param  inStream          The input stream to use for standard input.
   *
   * @return  An integer value of zero if the file was deleted successfully, or
   *          some other value if a problem occurred.
@@ -206,7 +199,6 @@
              .description(INFO_DSCORE_DESCRIPTION_LASTKNOWNGOODCFG.get())
              .buildAndAddToParser(argParser);
      // Not used in this class, but required by the start-ds script (see issue #3814)
      quietMode = quietArgument();
      argParser.addArgument(quietMode);
@@ -276,7 +268,6 @@
    // If an output file was specified and we could open the log file, open it
    // and append data to it.
    RandomAccessFile outputFile = null;
    long outputFileOffset = 0L;
    if (logFile != null && outputFilePath.isPresent())
    {
      try
@@ -285,8 +276,7 @@
        if (f.exists())
        {
          outputFile = new RandomAccessFile(f, "rw");
          outputFileOffset = outputFile.length();
          outputFile.seek(outputFileOffset);
          outputFile.seek(outputFile.length());
        }
      }
      catch (Exception e)
@@ -330,23 +320,20 @@
            int bytesRead = logFile.read(logBuffer);
            if (bytesRead > 0)
            {
              if (outputFile == null)
              if (outputFile != null)
              {
                outputFile.write(logBuffer, 0, bytesRead);
              }
              else if (!quietMode.isPresent())
              {
                getOutputStream().write(logBuffer, 0, bytesRead);
                getOutputStream().flush();
              }
              else
              {
                // Write on the file.
                // TODO
                outputFile.write(logBuffer, 0, bytesRead);
              }
              logFileOffset += bytesRead;
            }
          }
        }
        catch (Exception e)
        catch (Exception ignored)
        {
          // We'll just ignore this.
        }
@@ -362,7 +349,7 @@
        try
        {
          Thread.sleep(10);
        } catch (InterruptedException ie) {}
        } catch (InterruptedException ignored) {}
      }
    }