Open faizananwerali opened 4 years ago
Unfortunately my smb server has folders with round brackets in folder name. how do I add these brackets om (DiskShare) session.connectShare?
public static void main(String[] args) throws Exception { // TODO Auto-generated method stub @SuppressWarnings("resource") SMBClient client = new SMBClient(); try (Connection connection = client.connect("10.100.0.5")) { AuthenticationContext ac = new AuthenticationContext("", "".toCharArray(), "WORKGROUP"); Session session = connection.authenticate(ac); // Connect to Share try (DiskShare share = (DiskShare) session.connectShare("English (2018)")) { //System.out.println(share.list("")); /*for (FileIdBothDirectoryInformation f : share.list("FOLDER", "*.TXT")) {*/ for (FileIdBothDirectoryInformation f : share.list("")) { System.out.println("File : " + f.getFileName()); } } } }
That Code looks correct. What's the error you are getting? (Note that a Share is not a folder, are you sure this is the share name?)
Unfortunately my smb server has folders with round brackets in folder name. how do I add these brackets om (DiskShare) session.connectShare?