Class MapResourceCreator
- java.lang.Object
-
- org.codehaus.commons.compiler.util.resource.MapResourceCreator
-
- All Implemented Interfaces:
ResourceCreator
public class MapResourceCreator extends java.lang.Object implements ResourceCreator
Creates resources as byte arrays in a delegateMap
.
-
-
Constructor Summary
Constructors Constructor Description MapResourceCreator()
Auto-create the delegateMap
.MapResourceCreator(java.util.Map<java.lang.String,byte[]> map)
-
Method Summary
All Methods Instance 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.java.util.Map<java.lang.String,byte[]>
getMap()
-
-
-
Method Detail
-
getMap
public final java.util.Map<java.lang.String,byte[]> getMap()
- Returns:
- The
String
-to-byte[]
map of the resources created
-
createResource
public final java.io.OutputStream createResource(java.lang.String resourceName)
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
-
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
-
-