forked from I2P_Developers/i2p.i2p
2006-02-16 jrandom
* Bugfix to the I2PTunnel web config to properly accept i2cp port settings * Initial sucker refactoring to simplify reuse of the html parsing * Beginnings of hooks to push imported rss/atom out to remote syndie archives automatically (though not enabled currently) * Further SSU peer test cleanup
This commit is contained in:
@ -148,10 +148,18 @@ public class EepGet {
|
||||
}
|
||||
|
||||
public static String suggestName(String url) {
|
||||
int last = url.lastIndexOf('/');
|
||||
if ((last < 0) || (url.lastIndexOf('#') > last))
|
||||
last = url.lastIndexOf('#');
|
||||
if ((last < 0) || (url.lastIndexOf('?') > last))
|
||||
last = url.lastIndexOf('?');
|
||||
if ((last < 0) || (url.lastIndexOf('=') > last))
|
||||
last = url.lastIndexOf('=');
|
||||
|
||||
String name = null;
|
||||
if (url.lastIndexOf('/') >= 0)
|
||||
name = sanitize(url.substring(url.lastIndexOf('/')+1));
|
||||
if (name != null)
|
||||
if (last >= 0)
|
||||
name = sanitize(url.substring(last+1));
|
||||
if ( (name != null) && (name.length() > 0) )
|
||||
return name;
|
||||
else
|
||||
return sanitize(url);
|
||||
|
Reference in New Issue
Block a user