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 Object implements ResourceCreator
Stores a stream of bytes in a named resource.
  • Constructor Details

    • FileResourceCreator

      public FileResourceCreator()
  • Method Details

    • createResource

      public final OutputStream createResource(String resourceName) throws IOException
      Description copied from interface: ResourceCreator
      Creates 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