As Windows 2012R2 no longer supports the SMB1 protocol without some registry hacks has any had any success working with SMB shares in Java where only SMB2.1 or SMB3 are supported? the JCIFS library is apparently SMB1 only so it is out. I see that Microsoft have a Java library for Azure but this appears to be utilising services rather than SMB.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Expanding on @Breakidi answer, I've just used
hierynomus/smbj
v0.2.0 on Android and added SMB2 support. It claims support for both SMB2 and SMB3 although classes reference only SMB2 versions, not sure, maybe it is irrelevant.Testing
I've tested it against box running SMB2 open in one case and then both SMB2 and SMB3 open in another. I could not disable SMB2 and test SMB3 alone though.
Bouncycastle/Spongycastle
There was a need to use Spongycastle in my case (most likely because of Android) as required MD4 dependency was missing from classpath. I've used it within my class that connects to SMB:
Uploading file
Make sure you set correct flags when call
openFile
on aDiskShare
(by looking into source code off course):Visuality Systems is currently developing JNQ which is Java-based SMB with as far as 3.1.1 support. Since the requirement contains a backwards support for Java 1.4, the development goes slowly. SMB client will be available somewhere in the coming summer, server will come later.
I found this package that can work with SMB2 and SMB3, named smbj Take a look at this: https://github.com/hierynomus/smbj
when use hierynomus/smbj v0.3.0, I get the exception like "
ClassNotFoundException: sun.security.provider.MD4
", then i use the follow code to resolve the problem.