Package net.solarnetwork.io
Class DeleteOnCloseFileResource
java.lang.Object
net.solarnetwork.io.DeleteOnCloseFileResource
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class DeleteOnCloseFileResource
extends Object
implements org.springframework.core.io.Resource
- Since:
- 1.43
- Version:
- 1.1
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionDeleteOnCloseFileResource(org.springframework.core.io.Resource delegate) Construct from a resource.DeleteOnCloseFileResource(org.springframework.core.io.Resource delegate, File file) Construct from a resource and explicit file. -
Method Summary
-
Constructor Details
-
DeleteOnCloseFileResource
Construct from a resource.The
Resource.getFile()method will determine the file to delete.- Parameters:
delegate- the resource to delegate to- Throws:
IOException- if a file cannot be determined for the resource
-
DeleteOnCloseFileResource
Construct from a resource and explicit file.- Parameters:
delegate- the resource to delegate tofile- the file to delete after reading
-
-
Method Details
-
toString
-
getInputStream
- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource- Throws:
IOException
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.springframework.core.io.Resource
-
isReadable
public boolean isReadable()- Specified by:
isReadablein interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.springframework.core.io.Resource
-
getURL
- Specified by:
getURLin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getURI
- Specified by:
getURIin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFile
- Specified by:
getFilein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
contentLength
- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
lastModified
- Specified by:
lastModifiedin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
createRelative
- Specified by:
createRelativein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFilename
- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource
-
getDescription
- Specified by:
getDescriptionin interfaceorg.springframework.core.io.Resource
-