Interface IOProvider


public interface IOProvider
The IOProvider is an interface to provide more control of sending output from JSP Java and Class generation phases as well as cleaning up in case of problems.
  • Method Details

    • getOutputStream

      OutputStream getOutputStream(String fileName) throws IOException
      Parameters:
      fileName - The absolute path name of the destination into which to write the output. The semantics of this path depends on the implementation of this interface.
      Returns:
      an OutputStream into which to write the generated output.
      Throws:
      IOException - If the output stream cannot be created for the file.
    • getInputStream

      InputStream getInputStream(String fileName) throws FileNotFoundException, IOException
      Returns an input stream to a file which has been written through a stream obtained form getOutputStream(String)
      Parameters:
      fileName - The absolute path name of the source from which to read the input. The semantics of this path depends on the implementation of this interface.
      Returns:
      an InputStream from which to read the input.
      Throws:
      FileNotFoundException - If the file cannot be found
      IOException - If any other error occurs.
    • delete

      boolean delete(String fileName)
      Remove a generated output.
      Parameters:
      fileName - The absolute path name of the item to remove. The semantics of this path depends on the implementation of this interface.
      Returns:
      true if the item could be removed, otherwise false is removed.
    • rename

      boolean rename(String oldFileName, String newFileName)
      Renames the the file from the old file to the new file name
      Parameters:
      oldFileName -
      newFileName -
      Returns:
      true if renaming succeeded
    • mkdirs

      boolean mkdirs(String path)
      Creates folders (folder like) structures, such that a container for data is available at the given path.

      In the case of a OS Filesystem implementation, this method would be implemented by means of new java.io.File(path).mkdirs().

      Parameters:
      path - The absolute path of the folder to create.
      Returns:
      true if and only if the folder was created, along with all necessary parent directories; false otherwise.
    • lastModified

      long lastModified(String fileName)
      Returns the last modification time stamp of the resource (generally a file) at the given absolute location.
      Parameters:
      fileName - The absolute path to the file whose last modification time stamp is to be returned.
      Returns:
      The last modification time stamp of the resource in milliseconds since the epoch or -1 if no resource exists at the given location.
    • getClassLoader

      ClassLoader getClassLoader()
      Return the class loader to use
    • getJavaCompiler

      JavaCompiler getJavaCompiler()
      Return the Java Compiler
    • getClassLoaderWriter

      ClassLoaderWriter getClassLoaderWriter()
      Return the class loader writer