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
Post a Comment