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(String path)
          Delete the class/resource
 InputStream getInputStream(String path)
          Get the input stream for a class or resource handled by the underlying class loader.
 long getLastModified(String path)
          Return the last modified for the class or resource.
 OutputStream getOutputStream(String path)
          Get the output stream for a class or resource handled by the underlying class loader.
 boolean rename(String oldPath, String newPath)
          Rename a class/resource.
 

Method Detail

getOutputStream

OutputStream getOutputStream(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

InputStream getInputStream(String path)
                           throws 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:
IOException - If the resource/class does not exist.

getLastModified

long getLastModified(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(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(String oldPath,
               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-2011 The Apache Software Foundation. All Rights Reserved.