MCPcopy Create free account
hub / github.com/M66B/FairEmail / getURLName

Method getURLName

app/src/main/java/javax/mail/Folder.java:169–203  ·  view source on GitHub ↗

Return a URLName representing this folder. The returned URLName does not include the password used to access the store. @return the URLName representing this folder @exception MessagingException for failures @see URLName @since JavaMail 1.1

()

Source from the content-addressed store, hash-verified

167 * @since JavaMail 1.1
168 */
169 public URLName getURLName() throws MessagingException {
170 URLName storeURL = getStore().getURLName();
171 String fullname = getFullName();
172 StringBuilder encodedName = new StringBuilder();
173
174 if (fullname != null) {
175 /*
176 // We need to encode each of the folder's names.
177 char separator = getSeparator();
178 StringTokenizer tok = new StringTokenizer(
179 fullname, new Character(separator).toString(), true);
180
181 while (tok.hasMoreTokens()) {
182 String s = tok.nextToken();
183 if (s.charAt(0) == separator)
184 encodedName.append(separator);
185 else
186 // XXX - should encode, but since there's no decoder...
187 //encodedName.append(java.net.URLEncoder.encode(s));
188 encodedName.append(s);
189 }
190 */
191 // append the whole thing, until we can encode
192 encodedName.append(fullname);
193 }
194
195 /*
196 * Sure would be convenient if URLName had a
197 * constructor that took a base URLName.
198 */
199 return new URLName(storeURL.getProtocol(), storeURL.getHost(),
200 storeURL.getPort(), encodedName.toString(),
201 storeURL.getUsername(),
202 null /* no password */);
203 }
204
205 /**
206 * Returns the Store that owns this Folder object.

Callers 2

folderNameMethod · 0.45
verifySettings0Method · 0.45

Calls 8

getStoreMethod · 0.95
getFullNameMethod · 0.95
getProtocolMethod · 0.95
getHostMethod · 0.95
getPortMethod · 0.95
getUsernameMethod · 0.95
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected