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 Summary
Modifier and TypeMethodDescriptionboolean
Remove a generated output.Return the class loader to useReturn the class loader writergetInputStream
(String fileName) Returns an input stream to a file which has been written through a stream obtained formgetOutputStream(String)
Return the Java CompilergetOutputStream
(String fileName) long
lastModified
(String fileName) Returns the last modification time stamp of the resource (generally a file) at the given absolute location.boolean
Creates folders (folder like) structures, such that a container for data is available at the given path.boolean
Renames the the file from the old file to the new file name
-
Method Details
-
getOutputStream
- 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
Returns an input stream to a file which has been written through a stream obtained formgetOutputStream(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 foundIOException
- If any other error occurs.
-
delete
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, otherwisefalse
is removed.
-
rename
Renames the the file from the old file to the new file name- Parameters:
oldFileName
-newFileName
-- Returns:
true
if renaming succeeded
-
mkdirs
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
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
-