Java Path File Content writeString(String content, Path path)

Here you can find the source of writeString(String content, Path path)

Description

write String

License

Open Source License

Declaration

public static Path writeString(String content, Path path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static Path writeString(String content, Path path) {
        try {//from ww w . jav  a  2s.  co m
            Files.write(path, content.getBytes());
            return path;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. writeFile(String path, String content)
  2. writeFile(String path, String contents)
  3. writeFileContents(Path to, byte[] contents)
  4. writeJsonToFile(Path jsonPath, String jsonContent)
  5. writeLines(Path base, String file, String[] content)
  6. writeStringToFile(String content, Path targetPath)
  7. writeToBinaryFile(String filePath, byte[] binaryContent)
  8. writeToFile(Path absolutePath, byte[] content)
  9. writeToFile(Path file, String content)