public class FileSystemResource extends AbstractResource
| 构造器和说明 |
|---|
FileSystemResource(java.io.File file)
Create a new FileSystemResource from a File handle.
|
FileSystemResource(java.lang.String path)
Create a new FileSystemResource from a file path.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
exists()
whether the underlying file exists.
|
java.io.File |
getFile()
returns the underlying File reference.
|
protected java.io.File |
getFile2Check()
Determine the File to use for timestamp checking.
|
java.io.InputStream |
getInputStream()
Opens a FileInputStream for the underlying file.
|
java.io.OutputStream |
getOutputStream() |
java.lang.String |
getResourceLocation()
returns the absolute path of the file.
|
java.lang.String |
getResourceName()
returns the name of the file.
|
java.net.URI |
getURI()
returns a URI for the underlying file.
|
java.net.URL |
getURL()
returns a URL for the underlying file.
|
int |
hashCode() |
boolean |
isReadable()
whether the underlying file is marked as readable
|
lastModified, toStringpublic FileSystemResource(java.io.File file)
file - a File handlepublic FileSystemResource(java.lang.String path)
path - a file pathpublic boolean exists()
exists 在接口中 Resourceexists 在类中 AbstractResourcepublic boolean isReadable()
isReadable 在接口中 ResourceisReadable 在类中 AbstractResourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic java.net.URL getURL()
throws java.io.IOException
java.io.IOExceptionpublic java.net.URI getURI()
throws java.io.IOException
getURI 在接口中 ResourcegetURI 在类中 AbstractResourcejava.io.IOExceptionpublic java.io.File getFile()
public java.lang.String getResourceName()
public java.lang.String getResourceLocation()
protected java.io.File getFile2Check()
throws java.io.IOException
AbstractResourcegetFile2Check 在类中 AbstractResourcenull)java.io.IOException - if the resource cannot be resolved as absolute
file path, i.e. if the resource is not available in a file systempublic boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOExceptionCopyright © 2024. All Rights Reserved.