eclipse - Java resolve project path -


i trying return project's file path create file in said path. created file in path used static path project rather resolving programatically need do.

using docs i've tried creating file:

    path path = paths.get("c:\\folder\\folder\\folder\\folder\\folder\\report\\");     string filepath = path.tostring() + "filename.pdf";     createfile(filepath, data, moredata); 

question:

what if else uses d: drive or other? how resolve report folder if case?

use relative path file, rather absolute path.

path path = paths.get("reports/filename.pdf"); string filepath = path.tostring() + "filename.pdf"; createfile(filepath, data, moredata); 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -