Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create directories using samba client

I have a java code for samba client that puts a file from my unix machine to a windows machine. I need to check if a directory exits, and if not, create the directory and then put the file in that directory. I am able to put the file in an existing directory. It is the creating a new directory part that seems tricky.

like image 910
RK Poddar Avatar asked Oct 27 '25 10:10

RK Poddar


1 Answers

if you use JCIFS lib you can create a directory using SmbFile

 SmbFile sFile = new SmbFile(path, authentication);        
 sFile.mkdir();

For more information see the documentation

like image 72
Jens Avatar answered Oct 29 '25 00:10

Jens