MCPcopy Create free account
hub / github.com/FongMi/CatVodSpider / init

Method init

app/src/main/java/com/github/catvod/bean/samba/Drive.java:62–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 }
61
62 private void init() {
63 try {
64 smbClient = new SMBClient();
65 Uri uri = Uri.parse(getServer());
66 String[] parts = uri.getPath().substring(1).split("/", 2);
67 connection = smbClient.connect(uri.getHost(), uri.getPort() != -1 ? uri.getPort() : SMBClient.DEFAULT_PORT);
68 session = connection.authenticate(getAuthentication(uri));
69 diskShare = (DiskShare) session.connectShare(parts[0]);
70 subPath = parts.length > 1 ? parts[1] : "";
71 } catch (Exception e) {
72 e.printStackTrace();
73 }
74 }
75
76 private AuthenticationContext getAuthentication(Uri uri) {
77 String userInfo = uri.getUserInfo();

Callers 1

getShareMethod · 0.95

Calls 7

getServerMethod · 0.95
getAuthenticationMethod · 0.95
substringMethod · 0.80
parseMethod · 0.45
getPathMethod · 0.45
getHostMethod · 0.45
getPortMethod · 0.45

Tested by

no test coverage detected