org.drools.io.impl
Class ClassPathResource
java.lang.Object
org.drools.io.impl.BaseResource
org.drools.io.impl.ClassPathResource
- All Implemented Interfaces:
- Externalizable, Serializable, InternalResource, org.drools.io.Resource
public class ClassPathResource
- extends BaseResource
- implements InternalResource, Externalizable
Borrowed gratuitously from Spring under ASL2.0.
+
- See Also:
- Serialized Form
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,
Class<?> clazz,
ClassLoader classLoader)
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal
in interface Externalizable
- Throws:
IOException
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal
in interface Externalizable
- 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.drools.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
getReader
public Reader getReader()
throws IOException
- Specified by:
getReader
in interface org.drools.io.Resource
- Throws:
IOException
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory
in interface InternalResource
listResources
public Collection<org.drools.io.Resource> listResources()
- Specified by:
listResources
in interface InternalResource
getClassLoader
public ClassLoader getClassLoader()
getClazz
public Class<?> getClazz()
getPath
public String getPath()
setLastRead
protected void setLastRead(long lastRead)
equals
public boolean equals(Object object)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.