0

I'm working on a Google Cloud project where I need to access a series of .csv files from a certain directory in my project. I believe I've made all of the files available in the cloud using the appengine-web.xml file with the following code:

<resource-files>
<include path="/path/to/files/**.csv" /> </resource-files>

When I try to access the files using the direct path to the file I get a "No such file or directory" exception. I've done some digging into other posts, and it seems as though I need to access the files from the current working directory, rather than the path to the file. How would I go about forming this path in Java? I'm unsure of how to ".." out of directories, so that I can then navigate the path to where it needs to be. Thanks!

norbjd
  • 10,166
  • 4
  • 45
  • 80
murky123
  • 120
  • 6
  • 1
    You have File.getParent() to go one level up in the folder structure – Animesh Sahu Apr 13 '20 at 15:43
  • Is there any way to do it so that I will always go up to the top level of the directory regardless of where I'm at? Calling File.getParent() would work if I were in the same directory every time, but sometimes I am not. I've got the paths to all of the files saved, but I just need to get to the same top level directory every time so that I can use the file path as intended – murky123 Apr 13 '20 at 15:47

0 Answers0