public Credentials getOleFsMvnCredentials() { Credentials c = new Credentials(); c.setUsername("olefsmvn"); c.setPassword("olefsmvn"); c.setUrl("jdbc:mysql://localhost/olefsmvn"); return c; }
/** * @param username User * @param password Secret */ public void setCredentials(final String username, final String password) { credentials.setUsername(username); credentials.setPassword(password); }
/** @param serialized A valid bookmark dictionary */ public <T> Host(T serialized) { final Deserializer dict = DeserializerFactory.createDeserializer(serialized); Object uuidObj = dict.stringForKey("UUID"); if (uuidObj != null) { this.setUuid(uuidObj.toString()); } Object protocolObj = dict.stringForKey("Protocol"); if (protocolObj != null) { this.setProtocol(ProtocolFactory.forName(protocolObj.toString())); } Object providerObj = dict.stringForKey("Provider"); if (providerObj != null) { this.setProtocol(ProtocolFactory.forName(providerObj.toString())); } Object hostnameObj = dict.stringForKey("Hostname"); if (hostnameObj != null) { this.setHostname(hostnameObj.toString()); } Object usernameObj = dict.stringForKey("Username"); if (usernameObj != null) { credentials.setUsername(usernameObj.toString()); } Object passwordObj = dict.stringForKey("Password"); if (passwordObj != null) { credentials.setPassword(passwordObj.toString()); } Object cdnCredentialsObj = dict.stringForKey("CDN Credentials"); if (cdnCredentialsObj != null) { cdnCredentials.setUsername(cdnCredentialsObj.toString()); } Object keyObj = dict.stringForKey("Private Key File"); if (keyObj != null) { this.getCredentials().setIdentity(LocalFactory.createLocal(keyObj.toString())); } Object portObj = dict.stringForKey("Port"); if (portObj != null) { this.setPort(Integer.parseInt(portObj.toString())); } Object pathObj = dict.stringForKey("Path"); if (pathObj != null) { this.setDefaultPath(pathObj.toString()); } Object workdirObj = dict.stringForKey("Workdir"); if (workdirObj != null) { this.setWorkdir(workdirObj.toString()); } Object nicknameObj = dict.stringForKey("Nickname"); if (nicknameObj != null) { this.setNickname(nicknameObj.toString()); } Object encodingObj = dict.stringForKey("Encoding"); if (encodingObj != null) { this.setEncoding(encodingObj.toString()); } Object connectModeObj = dict.stringForKey("FTP Connect Mode"); if (connectModeObj != null) { if (connectModeObj.toString().equals(FTPConnectMode.PORT.toString())) { this.setFTPConnectMode(FTPConnectMode.PORT); } if (connectModeObj.toString().equals(FTPConnectMode.PASV.toString())) { this.setFTPConnectMode(FTPConnectMode.PASV); } } Object connObj = dict.stringForKey("Maximum Connections"); if (connObj != null) { this.setMaxConnections(Integer.valueOf(connObj.toString())); } Object downloadObj = dict.stringForKey("Download Folder"); if (downloadObj != null) { this.setDownloadFolder(LocalFactory.createLocal(downloadObj.toString())); } Object timezoneObj = dict.stringForKey("Timezone"); if (timezoneObj != null) { this.setTimezone(TimeZone.getTimeZone(timezoneObj.toString())); } Object commentObj = dict.stringForKey("Comment"); if (commentObj != null) { this.setComment(commentObj.toString()); } Object urlObj = dict.stringForKey("Web URL"); if (urlObj != null) { this.setWebURL(urlObj.toString()); } Object accessObj = dict.stringForKey("Access Timestamp"); if (accessObj != null) { this.setTimestamp(new Date(Long.parseLong(accessObj.toString()))); } }