org.drools.core.io.impl
Class ClassPathResource
java.lang.Object
org.drools.core.io.impl.BaseResource
org.drools.core.io.impl.ClassPathResource
- All Implemented Interfaces:
- Externalizable, Serializable, InternalResource, org.kie.api.io.Resource
public class ClassPathResource
- extends BaseResource
- implements InternalResource, Externalizable
Borrowed gratuitously from Spring under ASL2.0.
+
- See Also:
- Serialized Form
|
Constructor Summary |
ClassPathResource()
|
ClassPathResource(String path)
|
ClassPathResource(String path,
Class<?> clazz)
|
ClassPathResource(String path,
ClassLoader classLoader)
|
ClassPathResource(String path,
String encoding)
|
ClassPathResource(String path,
String encoding,
Class<?> clazz)
|
ClassPathResource(String path,
String encoding,
Class<?> clazz,
ClassLoader classLoader)
|
ClassPathResource(String path,
String encoding,
ClassLoader classLoader)
|
| Methods inherited from class org.drools.core.io.impl.BaseResource |
addCategory, getBytes, getCategories, getConfiguration, getDescription, getResourceType, getSourcePath, getTargetPath, setCategories, setConfiguration, setDescription, setResourceType, setSourcePath, setTargetPath |
| Methods inherited from interface org.kie.api.io.Resource |
getSourcePath, getTargetPath, setSourcePath, setTargetPath |
ClassPathResource
public ClassPathResource()
ClassPathResource
public ClassPathResource(String path)
ClassPathResource
public ClassPathResource(String path,
Class<?> clazz)
ClassPathResource
public ClassPathResource(String path,
ClassLoader classLoader)
ClassPathResource
public ClassPathResource(String path,
String encoding)
ClassPathResource
public ClassPathResource(String path,
String encoding,
Class<?> clazz)
ClassPathResource
public ClassPathResource(String path,
String encoding,
ClassLoader classLoader)
ClassPathResource
public ClassPathResource(String path,
String encoding,
Class<?> clazz,
ClassLoader classLoader)
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class BaseResource
- Throws:
IOException
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class BaseResource
- Throws:
IOException
ClassNotFoundException
getInputStream
public InputStream getInputStream()
throws IOException
- This implementation opens an InputStream for the given class path resource.
- Specified by:
getInputStream in interface org.kie.api.io.Resource
- Throws:
IOException- See Also:
ClassLoader.getResourceAsStream(String),
Class.getResourceAsStream(String)
getURL
public URL getURL()
throws IOException
- This implementation returns a URL for the underlying class path resource.
- Specified by:
getURL in interface InternalResource
- Throws:
IOException- See Also:
ClassLoader.getResource(String),
Class.getResource(String)
hasURL
public boolean hasURL()
- Specified by:
hasURL in interface InternalResource
getLastModified
public long getLastModified()
- Specified by:
getLastModified in interface InternalResource
getLastRead
public long getLastRead()
- Specified by:
getLastRead in interface InternalResource
getEncoding
public String getEncoding()
getReader
public Reader getReader()
throws IOException
- Specified by:
getReader in interface org.kie.api.io.Resource
- Throws:
IOException
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory in interface InternalResource
listResources
public Collection<org.kie.api.io.Resource> listResources()
- Specified by:
listResources in interface InternalResource
getClassLoader
public ClassLoader getClassLoader()
setClassLoader
public void setClassLoader(ClassLoader classLoader)
getClazz
public Class<?> getClazz()
getPath
public String getPath()
setLastRead
protected void setLastRead(long lastRead)
equals
public boolean equals(Object object)
- Overrides:
equals in class BaseResource
hashCode
public int hashCode()
- Overrides:
hashCode in class BaseResource
toString
public String toString()
- Overrides:
toString in class BaseResource
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.