org.codehaus.janino.util.resource
Class FileResourceCreator
java.lang.Object
org.codehaus.janino.util.resource.FileResourceCreator
- All Implemented Interfaces:
- ResourceCreator
- Direct Known Subclasses:
- DirectoryResourceCreator
public abstract class FileResourceCreator
- extends Object
- implements ResourceCreator
Stores a stream of bytes in a named resource.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileResourceCreator
public FileResourceCreator()
createResource
public final OutputStream createResource(String resourceName)
throws IOException
- Description copied from interface:
ResourceCreator
- Create the designated resource.
- Specified by:
createResource in interface ResourceCreator
- Parameters:
resourceName - Designates the resource; typically structured by slashes ("/") like
"com/foo/pkg/Bar.class"
- Returns:
- Bytes written to this
OutputStream are stored in the resource
- Throws:
IOException - Problems creating the resource
deleteResource
public final boolean deleteResource(String resourceName)
- Description copied from interface:
ResourceCreator
- Deletes the resource with the given name.
- Specified by:
deleteResource in interface ResourceCreator
- Returns:
false if the resource could not be deleted
getFile
protected abstract File getFile(String resourceName)
- Returns:
- The file into which the contents is written