Class FileResourceCreator
- java.lang.Object
-
- org.codehaus.commons.compiler.util.resource.FileResourceCreator
-
- All Implemented Interfaces:
ResourceCreator
- Direct Known Subclasses:
DirectoryResourceCreator
public abstract class FileResourceCreator extends java.lang.Object implements ResourceCreator
Stores a stream of bytes in a named resource.
-
-
Constructor Summary
Constructors Constructor Description FileResourceCreator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.io.OutputStream
createResource(java.lang.String resourceName)
Creates the designated resource.boolean
deleteResource(java.lang.String resourceName)
Deletes the resource with the given name.protected abstract java.io.File
getFile(java.lang.String resourceName)
-
-
-
Method Detail
-
createResource
public final java.io.OutputStream createResource(java.lang.String resourceName) throws java.io.IOException
Description copied from interface:ResourceCreator
Creates the designated resource.- Specified by:
createResource
in interfaceResourceCreator
- 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:
java.io.IOException
- Problems creating the resource
-
deleteResource
public final boolean deleteResource(java.lang.String resourceName)
Description copied from interface:ResourceCreator
Deletes the resource with the given name.- Specified by:
deleteResource
in interfaceResourceCreator
- Returns:
false
if the resource could not be deleted
-
getFile
protected abstract java.io.File getFile(java.lang.String resourceName)
- Returns:
- The file into which the contents is written
-
-