UrlResource or ClassPathResource.
Detects the "file" protocol as well as the JBoss "vfs" protocol in URLs, resolving file system references accordingly.
| Modifier and Type | Class and Description |
|---|---|
| private static class | AbstractFileResolvingResource.
Inner delegate class, avoiding a hard JBoss VFS API dependency at runtime. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| public long | contentLength()
Overrides org. Implements org. This method reads the entire InputStream to determine the content length. |
| protected void | customizeConnection(URLConnection
the URLConnection to customize con)Customize the given |
| protected void | customizeConnection(HttpURLConnection
the HttpURLConnection to customize con)Customize the given |
| public boolean | exists()
Overrides org. Implements org. This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. |
| public File | getFile()
Overrides org. Implements org. This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system. |
| protected File | |
| protected File | getFileForLastModifiedCheck()
Overrides org. This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip). |
| public boolean | isFile()
Overrides org. Overrides default org. This implementation always returns |
| protected boolean | |
| public boolean | isReadable()
Overrides org. Overrides default org. This implementation always returns |
| public long | lastModified()
Overrides org. Implements org. This implementation checks the timestamp of the underlying File, if available. |
| public ReadableByteChannel | readableChannel()
Overrides org. Overrides default org. This implementation returns a FileChannel for the given URI-identified resource, provided that it refers to a file in the file system. |
| AbstractFileResolvingResource | back to summary |
|---|---|
| public AbstractFileResolvingResource() | |
| checkReadable | back to summary |
|---|---|
| pack-priv boolean checkReadable(URL url) | |
| contentLength | back to summary |
|---|---|
| public long contentLength() throws IOException Overrides org. Implements org. Doc from org. This method reads the entire InputStream to determine the content length. For a custom subclass of
| |
| customizeConnection | back to summary |
|---|---|
| protected void customizeConnection(URLConnection con) throws IOException Customize the given Calls
| |
| customizeConnection | back to summary |
|---|---|
| protected void customizeConnection(HttpURLConnection con) throws IOException Customize the given Can be overridden in subclasses for configuring request headers and timeouts.
| |
| exists | back to summary |
|---|---|
| public boolean exists() Overrides org. Implements org. Doc from org. This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.
| |
| getFile | back to summary |
|---|---|
| public File getFile() throws IOException Overrides org. Implements org. This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
| |
| getFile | back to summary |
|---|---|
| protected File getFile(URI uri) throws IOException This implementation returns a File reference for the given URI-identified resource, provided that it refers to a file in the file system. | |
| getFileForLastModifiedCheck | back to summary |
|---|---|
| protected File getFileForLastModifiedCheck() throws IOException Overrides org. This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).
| |
| isFile | back to summary |
|---|---|
| public boolean isFile() Overrides org. Overrides default org. Doc from org. This implementation always returns
| |
| isFile | back to summary |
|---|---|
| protected boolean isFile(URI uri) Determine whether the given
| |
| isReadable | back to summary |
|---|---|
| public boolean isReadable() Overrides org. Overrides default org. Doc from org. This implementation always returns
| |
| lastModified | back to summary |
|---|---|
| public long lastModified() throws IOException Overrides org. Implements org. Doc from org. This implementation checks the timestamp of the underlying File, if available.
| |
| readableChannel | back to summary |
|---|---|
| public ReadableByteChannel readableChannel() throws IOException Overrides org. Overrides default org. This implementation returns a FileChannel for the given URI-identified resource, provided that it refers to a file in the file system.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Resource | |
| public static Resource |
| VfsResourceDelegate | back to summary |
|---|---|
| private VfsResourceDelegate() | |
| getResource | back to summary |
|---|---|
| public static Resource getResource(URL url) throws IOException | |
| getResource | back to summary |
|---|---|
| public static Resource getResource(URI uri) throws IOException | |