new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java
public static void replaceStringInFile(String filePath, String oldValue, String newValue)
      throws IOException {
    LoggingFacade logger = getLogger();
    Path src = Paths.get(filePath);
    logger.info("Copying {0}", src.toString());
    Charset charset = StandardCharsets.UTF_8;
    String content = new String(Files.readAllBytes(src), charset);
    content = content.replaceAll(oldValue, newValue);
    logger.info("to {0}", src.toString());
    Files.write(src, content.getBytes(charset));
  }
/**
   * A utility method to sed files.
   *
   * @throws java.io.IOException when copying files from source location to staging area fails
   */
A utility method to sed files.
@throws java.io.IOException when copying files from source location to staging area fails
A utility method to sed files . @throws java . io . IOException when copying files from source location to staging area fails
public static void replaceStringInFile(String filePath, String oldValue, String newValue)
      throws IOException {
    LoggingFacade logger = getLogger();
    Path src = Paths.get(filePath);
    logger.info("Copying {0}", src.toString());
    Charset charset = StandardCharsets.UTF_8;
    String content = new String(Files.readAllBytes(src), charset);
    content = content.replaceAll(oldValue, newValue);
    logger.info("to {0}", src.toString());
    Files.write(src, content.getBytes(charset));
  }
public static void replaceStringInFile ( String filePath , String oldValue , String newValue ) throws IOException { LoggingFacade logger = getLogger ( ) ; Path src = Paths . get ( filePath ) ; logger . info ( "Copying {0}" , src . toString ( ) ) ; Charset charset = StandardCharsets . UTF_8 ; String content = new String ( Files . readAllBytes ( src ) , charset ) ; content = content . replaceAll ( oldValue , newValue ) ; logger . info ( "to {0}" , src . toString ( ) ) ; Files . write ( src , content . getBytes ( charset ) ) ; }
A utility method to sed files.
A utility method to sed files .