Methods
static cleanFullpath(fullpath) → String
Cleans resource name (removing double slashes to avoid problems) It is slow, so use it only in changes, not in getters
fullpath |
String |
- String
static getBasename(fullpath) → String
Returns the filename without the folder or the extension
fullpath |
String |
- String
filename extension
static getExtension(fullpath, complexExtension) → String
Returns the filename extension from an url
fullpath |
String | fullpath url or filename |
|
complexExtension |
bool |
false
|
complex_extension [optional] returns the extension from the first dot, otherwise only the part from last dot. |
- String
filename extension
static getFilename(fullpath) → String
Returns the filename from a full path
fullpath |
String |
- String
filename extension
static getFolder(fullpath) → String
Returns the folder from a fullpath. This includes the server address, and everything up to the first /.
fullpath |
* |
- String
folder name
static getNoCache() → String
Returns a string to append to any url that should use the browser cache (when updating server info)
- String
static getProtocol(url) → String
Returns the url protocol (http, https) or empty string if no protocol was found
url |
String |
- String
static parseQueryString(url) → Object
Parse the parameters from a GET url.
url |
String | The URL to parse, such as "http://foo.com/t.html?a=1&b=3&c=m2-m3" |
- Object
The map of parsed parameters, in the form {name:value}.
static removeExtension(fullpath, complexExtension) → String
Returns the url without the extension
fullpath |
String | url or filename |
|
complexExtension |
bool |
false
|
removes the extension from the first dot, otherwise only the part from last dot. |
- String
url without extension
static replaceExtension(fullpath, extension, complexExtension) → String
Replaces the extension of a filename
fullpath |
String | url or filename |
|
extension |
String | The new extension to add to the file name. |
|
complexExtension |
bool |
false
|
If true, remove the old extension at the first dot, otherwise from the last dot. |
- String
url with the new extension