private void initialize ( String defaultDirectoryString , String directoryListString , String proxyFilename , String certFilename , String keyFilename ) throws IOException , CertificateException { if ( defaultDirectoryString != null ) { defaultDirectory = new GlobusPathMatchingResourcePatternResolver ( ) . getResource ( defaultDirectoryString ) . getFile ( ) ; if ( ! defaultDirectory . exists ( ) ) { boolean directoryMade = defaultDirectory . mkdirs ( ) ; if ( ! directoryMade ) { throw new IOException ( "Unable to create default certificate directory" ) ; } } loadDirectories ( defaultDirectoryString ) ; } if ( directoryListString != null ) { loadDirectories ( directoryListString ) ; } try { if ( proxyFilename != null && proxyFilename . length ( ) > 0 ) { loadProxyCertificate ( proxyFilename ) ; } if ( ( certFilename != null && certFilename . length ( ) > 0 ) && ( keyFilename != null && keyFilename . length ( ) > 0 ) ) { loadCertificateKey ( certFilename , keyFilename ) ; } } catch ( ResourceStoreException e ) { throw new CertificateException ( e ) ; } catch ( CredentialException e ) { e . printStackTrace ( ) ; throw new CertificateException ( e ) ; } }
Initialize resources from filename proxyfile name