public class ClassPathResource extends AbstractResource
Title: ClassPathResource.java
Description:
bboss workgroup
Copyright (c) 2007
savesize| 限定符 | 构造器和说明 |
|---|---|
|
ClassPathResource(java.lang.String path)
Create a new ClassPathResource for ClassLoader usage.
|
|
ClassPathResource(java.lang.String path,
java.lang.Class clazz)
Create a new ClassPathResource for Class usage.
|
|
ClassPathResource(java.lang.String path,
java.lang.ClassLoader classLoader)
Create a new ClassPathResource for ClassLoader usage.
|
protected |
ClassPathResource(java.lang.String path,
java.lang.ClassLoader classLoader,
java.lang.Class clazz)
Create a new ClassPathResource with optional ClassLoader and Class.
|
| 限定符和类型 | 方法和说明 |
|---|---|
org.frameworkset.util.io.Resource |
createRelative(java.lang.String relativePath)
This implementation creates a ClassPathResource, applying the given path
relative to the path of the underlying resource of this descriptor.
|
boolean |
equals(java.lang.Object obj)
This implementation compares the underlying class path locations.
|
java.lang.ClassLoader |
getClassLoader()
Return the ClassLoader that this resource will be obtained from.
|
java.lang.String |
getDescription()
This implementation returns a description that includes the class path location.
|
java.io.File |
getFile()
This implementation returns a File reference for the underlying class path
resource, provided that it refers to a file in the file system.
|
protected java.io.File |
getFileForLastModifiedCheck()
This implementation determines the underlying File
(or jar file, in case of a resource in a jar/zip).
|
java.lang.String |
getFilename()
This implementation returns the name of the file that this class path
resource refers to.
|
java.io.InputStream |
getInputStream()
This implementation opens an InputStream for the given class path resource.
|
java.lang.String |
getPath()
Return the path for this resource (as resource path within the class path).
|
java.net.URL |
getURL()
This implementation returns a URL for the underlying class path resource.
|
int |
hashCode()
This implementation returns the hash code of the underlying
class path location.
|
contentLength, exists, getSavesize, getURI, isOpen, isReadable, lastModified, release, savetofile, savetofile, toStringpublic ClassPathResource(java.lang.String path)
The thread context class loader will be used for loading the resource.
path - the absolute path within the class pathClassLoader.getResourceAsStream(String),
ClassUtils.getDefaultClassLoader()public ClassPathResource(java.lang.String path,
java.lang.ClassLoader classLoader)
path - the absolute path within the classpathclassLoader - the class loader to load the resource with,
or null for the thread context class loaderClassLoader.getResourceAsStream(String)public ClassPathResource(java.lang.String path,
java.lang.Class clazz)
path - relative or absolute path within the class pathclazz - the class to load resources withClass.getResourceAsStream(java.lang.String)protected ClassPathResource(java.lang.String path,
java.lang.ClassLoader classLoader,
java.lang.Class clazz)
path - relative or absolute path within the classpathclassLoader - the class loader to load the resource with, if anyclazz - the class to load resources with, if anypublic final java.lang.String getPath()
public final java.lang.ClassLoader getClassLoader()
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionClassLoader.getResourceAsStream(String),
Class.getResourceAsStream(String)public java.net.URL getURL()
throws java.io.IOException
getURL 在接口中 org.frameworkset.util.io.ResourcegetURL 在类中 AbstractResourcejava.io.IOExceptionClassLoader.getResource(String),
Class.getResource(String)public java.io.File getFile()
throws java.io.IOException
getFile 在接口中 org.frameworkset.util.io.ResourcegetFile 在类中 AbstractResourcejava.io.IOExceptionResourceUtils.getFile(java.net.URL, String)protected java.io.File getFileForLastModifiedCheck()
throws java.io.IOException
getFileForLastModifiedCheck 在类中 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 org.frameworkset.util.io.Resource createRelative(java.lang.String relativePath)
createRelative 在接口中 org.frameworkset.util.io.ResourcecreateRelative 在类中 AbstractResourceStringUtils#applyRelativePath(String, String)public java.lang.String getFilename()
getFilename 在接口中 org.frameworkset.util.io.ResourcegetFilename 在类中 AbstractResourceStringUtils#getFilename(String)public java.lang.String getDescription()
public boolean equals(java.lang.Object obj)
equals 在类中 AbstractResourceResource.getDescription()public int hashCode()
hashCode 在类中 AbstractResourceResource.getDescription()