|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2020 the original author or authors. |
|
|
|
* Copyright 2002-2022 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -60,6 +60,18 @@ public class UrlResource extends AbstractFileResolvingResource { |
|
|
|
private volatile URL cleanedUrl; |
|
|
|
private volatile URL cleanedUrl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Create a new {@code UrlResource} based on the given URL object. |
|
|
|
|
|
|
|
* @param url a URL |
|
|
|
|
|
|
|
* @see #UrlResource(URI) |
|
|
|
|
|
|
|
* @see #UrlResource(String) |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public UrlResource(URL url) { |
|
|
|
|
|
|
|
Assert.notNull(url, "URL must not be null"); |
|
|
|
|
|
|
|
this.uri = null; |
|
|
|
|
|
|
|
this.url = url; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new {@code UrlResource} based on the given URI object. |
|
|
|
* Create a new {@code UrlResource} based on the given URI object. |
|
|
|
* @param uri a URI |
|
|
|
* @param uri a URI |
|
|
|
@ -72,16 +84,6 @@ public class UrlResource extends AbstractFileResolvingResource { |
|
|
|
this.url = uri.toURL(); |
|
|
|
this.url = uri.toURL(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Create a new {@code UrlResource} based on the given URL object. |
|
|
|
|
|
|
|
* @param url a URL |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public UrlResource(URL url) { |
|
|
|
|
|
|
|
Assert.notNull(url, "URL must not be null"); |
|
|
|
|
|
|
|
this.uri = null; |
|
|
|
|
|
|
|
this.url = url; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new {@code UrlResource} based on a URL path. |
|
|
|
* Create a new {@code UrlResource} based on a URL path. |
|
|
|
* <p>Note: The given path needs to be pre-encoded if necessary. |
|
|
|
* <p>Note: The given path needs to be pre-encoded if necessary. |
|
|
|
|