org.apache.sling.commons.classloader
Interface ClassLoaderWriter


public interface ClassLoaderWriter

The class loader writer allows to modify the resources loaded by a DynamicClassLoaderProvider. For example a class loader writer could write generated class files into the repository or the temporary file system.


Method Summary
 boolean delete(java.lang.String path)
          Delete the class/resource
 java.io.InputStream getInputStream(java.lang.String path)
          Get the input stream for a class or resource handled by the underlying class loader.
 long getLastModified(java.lang.String path)
          Return the last modified for the class or resource.
 java.io.OutputStream getOutputStream(java.lang.String path)
          Get the output stream for a class or resource handled by the underlying class loader.
 boolean rename(java.lang.String oldPath, java.lang.String newPath)
          Rename a class/resource.
 

Method Detail

getOutputStream

java.io.OutputStream getOutputStream(java.lang.String path)
Get the output stream for a class or resource handled by the underlying class loader. If the resource/class does not exists it should be created.

Parameters:
path - The path of the class/resource.
Returns:
The output stream.

getInputStream

java.io.InputStream getInputStream(java.lang.String path)
                                   throws java.io.IOException
Get the input stream for a class or resource handled by the underlying class loader.

Parameters:
path - The path of the class/resource.
Returns:
The input stream for the resource/class.
Throws:
java.io.IOException - If the resource/class does not exist.

getLastModified

long getLastModified(java.lang.String path)
Return the last modified for the class or resource.

Parameters:
path - The path of the class/resource.
Returns:
The last modified information or -1 if the information can't be detected.

delete

boolean delete(java.lang.String path)
Delete the class/resource

Parameters:
path - The path of the class/resource.
Returns:
true if the resource exists and could be deleted, false otherwise.

rename

boolean rename(java.lang.String oldPath,
               java.lang.String newPath)
Rename a class/resource.

Parameters:
oldPath - The path of the class/resource.
newPath - The new path.
Returns:
true if the renaming has been successful.


Copyright © 2007-2009 The Apache Software Foundation. All Rights Reserved.