| org.apache.roller.business.FileManager
All known Subclasses: org.apache.roller.business.FileManagerImpl,
FileManager | public interface FileManager (Code) | | Interface for managing files uploaded to Roller.
|
Method Summary | |
public void | createDirectory(WebsiteData weblog, String path) Create an empty subdirectory in the weblog's uploads area. | public void | deleteFile(WebsiteData weblog, String path) Delete file or directory from weblog's uploads area. | public WeblogResource[] | getDirectories(WebsiteData weblog) Get list of directories from a weblog's uploads area.
This method will return an array of all dirs in the weblogs' uploads
area, otherwise it will throw an exception.
Parameters: weblog - The weblog we are working on. throws: FileNotFoundException - If path does not exist. throws: FilePathException - If path is invalid, or can't be read. | public WeblogResource | getFile(WebsiteData weblog, String path) Get a reference to a specific file in a weblog's uploads area.
This method always returns a valid file or will throw an exception
if the specificed path doesn't exist, is a directory, or can't be read.
Parameters: weblog - The weblog we are working on. Parameters: path - The relative path to the desired resource within the weblog's uploads area. throws: FileNotFoundException - If path does not exist. throws: FilePathException - If path is invalid, is a directory, or can't be read. | public WeblogResource[] | getFiles(WebsiteData weblog, String path) Get list of files from a specific path of the weblog's uploads area.
This method will return a WeblogResource[] array of all files at the
given path if it exists, otherwise it will throw an exception.
This method should return the files at the root of the weblog's uploads
area given a path value of null, "" (empty string), or "/"
This method should NOT return any resources which represent directories.
Parameters: weblog - The weblog we are working on. Parameters: path - The relative path to the desired resource within the weblog's uploads area. throws: FileNotFoundException - If path does not exist. throws: FilePathException - If path is invalid, is not a directory, or can't be read. | public boolean | overQuota(WebsiteData weblog) Is the given weblog over the file-upload quota limit?
Parameters: weblog - The weblog we are working on. | public void | release() Release all resources associated with Roller session. | public void | saveFile(WebsiteData weblog, String path, String contentType, long size, InputStream is) Save a file to weblog's uploads area. |
getFile | public WeblogResource getFile(WebsiteData weblog, String path) throws FileNotFoundException, FilePathException(Code) | | Get a reference to a specific file in a weblog's uploads area.
This method always returns a valid file or will throw an exception
if the specificed path doesn't exist, is a directory, or can't be read.
Parameters: weblog - The weblog we are working on. Parameters: path - The relative path to the desired resource within the weblog's uploads area. throws: FileNotFoundException - If path does not exist. throws: FilePathException - If path is invalid, is a directory, or can't be read. WeblogResource representing the real file resource. |
getFiles | public WeblogResource[] getFiles(WebsiteData weblog, String path) throws FileNotFoundException, FilePathException(Code) | | Get list of files from a specific path of the weblog's uploads area.
This method will return a WeblogResource[] array of all files at the
given path if it exists, otherwise it will throw an exception.
This method should return the files at the root of the weblog's uploads
area given a path value of null, "" (empty string), or "/"
This method should NOT return any resources which represent directories.
Parameters: weblog - The weblog we are working on. Parameters: path - The relative path to the desired resource within the weblog's uploads area. throws: FileNotFoundException - If path does not exist. throws: FilePathException - If path is invalid, is not a directory, or can't be read. WeblogResource[] of files in website's uploads area at given path. |
overQuota | public boolean overQuota(WebsiteData weblog)(Code) | | Is the given weblog over the file-upload quota limit?
Parameters: weblog - The weblog we are working on. True if weblog is over set quota, False otherwise. |
release | public void release()(Code) | | Release all resources associated with Roller session.
|
saveFile | public void saveFile(WebsiteData weblog, String path, String contentType, long size, InputStream is) throws FileNotFoundException, FilePathException, FileIOException(Code) | | Save a file to weblog's uploads area.
Parameters: weblog - The weblog we are working on. Parameters: path - The relative path to the desired location within the weblog's uploads area where the file should be saved. Parameters: contentType - Content type of the file. Parameters: size - Size of file to be saved. Parameters: is - InputStream to read the file from. throws: FileNotFoundException - If path to save location does not exist. throws: FilePathException - If path is invalid, is not a directory, or can't be read. throws: FileIOException - If there is an unexpected error during the save. |
|
|