A modern object orientated library for Samba SMB
0.11.5
SmbConnection
class can now delay the SMB connection until the first real SMB request is made (So called lazy initialization). This feature is useful for systems that create too many parallel SMB sessions that would exceed the SMB session pool. The SMB connection is made on the first method call that requires an active SMB connection.SmbConnection
class now provides a SmbConnection.isConnectionAlive()
method to check if the SMB connection is alive. If the SMB connection is not alive, a call to SmbConnection.ensureConnectionIsAlive()
recreates the SMB connection if required. This feature is useful for system that use a long living SmbConnection
where the SMB connection times out and it's not possible to recreate the SmbConnection
manually.SmbOutputStream
now provides two overloaded methods SmbOutputStream.write(bytes)
and SmbOutputStream.write(bytes, offset, length)
methods for more fine grained write scenarios. The second function only works in non-appending context.v0.10.0
SmbFile.getOutputStream(boolean appendContent)
SmbFile.isHidden()
SmbDirectory.listFiles()
Shared*
to Smb*
SmbItem.renameTo
method now returns the renamed item (The current object is not touched anymore because it is immutable)SharedDirectory.listFiles(Predicate<SharedItem> searchPredicate, boolean searchRecursive)
and SharedDirectory.listFiles(String searchPattern, boolean searchRecursive)
SharedItem.renameTo(String newFileName, boolean replaceIfExist)
SharedDirectory.ensureExists()
SharedConnection.close()
SharedFile.copyFileViaServerSideCopy(SharedFile destinationSharedFile)
. For more information check out this article: https://wiki.samba.org/index.php/Server-Side_Copy
SharedFile.getInputStream()
on a non-existing file, but instead fail with a smbj exceptionSmbConfig
config in the SharedConnection
README.md