Java File Object for a File in ADLS Gen2

298 views Asked by At

I have a tool that works for on-premise data upload. Basically, it reads the file from local system i.e.(on-premise: Linux or Windows) and send it over to a location. It makes use of Java File class. eg: new File("/dir/file.txt")

I want to make use of the same code for input files on ADLS Gen2. I would be running the code on Azure Databricks and stuck with getting the File object for the files in ADLS Gen2. I am using wasbs protocol for making the File object, but it is coming as null as Java is not recognizing the directory structure.

1

There are 1 answers

0
Alex Ott On

If this tool is using local file access, then you can still use it by mounting the ADLS as DBFS to some location, like, /mnt, and then use this mount locally as /dbfs/<mount-point> (/dbfs/mnt/).