public class DownloadingUrlResource
extends org.springframework.core.io.UrlResource
Resource
implementation that will download a UrlResource
to a temp file when
the is invoked.Constructor and Description |
---|
DownloadingUrlResource(String uri)
Create a new
DownloadingUrlResource based on the given URI object. |
Modifier and Type | Method and Description |
---|---|
String |
getDescription() |
File |
getFile()
Downloads the file from the HTTP location to a temporary file.
|
createRelative, equals, getFilename, getInputStream, getURI, getURL, hashCode, isFile
public DownloadingUrlResource(String uri) throws MalformedURLException
DownloadingUrlResource
based on the given URI object.uri
- a URIMalformedURLException
- if the given URL path is not validpublic File getFile() throws IOException
getFile
in interface org.springframework.core.io.Resource
getFile
in class org.springframework.core.io.UrlResource
IOException
- if there are errors downloading or writing the temporary file.public String getDescription()
getDescription
in interface org.springframework.core.io.Resource
getDescription
in class org.springframework.core.io.UrlResource
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.