Код: Выделить всё
SmbFile folder = SMBFileFactory.produceFileWithGuestCredentials(Constants.SMB_PATH_IMPORT_DIRECTORY);
if(folder == null)
return null;
try {
return folder.listFiles(new SmbFilenameFilter() {
Код: Выделить всё
public static SmbFile produceFileWithGuestCredentials(String path) {
try {
BaseContext bc = null;
Properties p = new Properties();
bc = new BaseContext(new PropertyConfiguration(p));
CIFSContext cc = bc.withGuestCrendentials();
SmbFile file = new SmbFile(path, cc);
return file;
}catch(MalformedURLException | CIFSException e) {
Logger.logExceptionSysOutEncapsulated(e, SMBFileFactory.class);
return null;
}
}
Код: Выделить всё
Exception in thread "main" java.lang.ClassCastException: class org.bouncycastle.asn1.DLApplicationSpecific cannot be cast to class org.bouncycastle.asn1.ASN1TaggedObject (org.bouncycastle.asn1.DLApplicationSpecific and org.bouncycastle.asn1.ASN1TaggedObject are in unnamed module of loader 'app')
at jcifs.spnego.NegTokenInit.parse(NegTokenInit.java:159)
at jcifs.spnego.NegTokenInit.(NegTokenInit.java:66)
at jcifs.smb.NtlmPasswordAuthenticator.createContext(NtlmPasswordAuthenticator.java:243)
at jcifs.smb.SmbSessionImpl.createContext(SmbSessionImpl.java:706)
at jcifs.smb.SmbSessionImpl.sessionSetupSMB2(SmbSessionImpl.java:544)
at jcifs.smb.SmbSessionImpl.sessionSetup(SmbSessionImpl.java:491)
at jcifs.smb.SmbSessionImpl.send(SmbSessionImpl.java:369)
at jcifs.smb.SmbSessionImpl.send(SmbSessionImpl.java:347)
at jcifs.smb.SmbTreeImpl.treeConnect(SmbTreeImpl.java:611)
at jcifs.smb.SmbTreeConnection.connectTree(SmbTreeConnection.java:614)
at jcifs.smb.SmbTreeConnection.connectHost(SmbTreeConnection.java:568)
at jcifs.smb.SmbTreeConnection.connectHost(SmbTreeConnection.java:489)
at jcifs.smb.SmbTreeConnection.connect(SmbTreeConnection.java:465)
at jcifs.smb.SmbTreeConnection.connectWrapException(SmbTreeConnection.java:426)
at jcifs.smb.SmbFile.ensureTreeConnected(SmbFile.java:559)
at jcifs.smb.SmbEnumerationUtil.doEnum(SmbEnumerationUtil.java:221)
at jcifs.smb.SmbEnumerationUtil.listFiles(SmbEnumerationUtil.java:279)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1270)
at com.ffleuchten.billparser.FileHandler.loadFilesFromSMB(FileHandler.java:24)
at com.ffleuchten.billparser.BillParser.run(BillParser.java:40)
at com.ffleuchten.billparser.KickStarter.main(KickStarter.java:14)
Кто-нибудь знает, в чем моя проблема?
Подробнее здесь: https://stackoverflow.com/questions/786 ... onspecific