Home > Blockchain >  How to import a file in a Java gradle project
How to import a file in a Java gradle project

Time:05-31

I have already read many guides and forums about it but I still haven't succeeded. The file must be in the project folder because it is a project for the university. I need to transform the contents of the file into a string so that I can then manipulate it as I need. If anyone can kindly show me the best way to do it I would be grateful.

CodePudding user response:

I assume that you want to read file content. Please try:

List<String> file = Files.readAllLines(Path.of(yourPath));

CodePudding user response:

https://docs.gradle.org/current/userguide/working_with_files.html

Did you check this? You working in a gradle script I believe ?

  • Related