pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.vfs
Interface VFSProvider

All Known Implementing Classes:
SingleFileSystemProvider

public interface VFSProvider

a provider for a VirtualFileSystem store.

Version:
$Revision: 1996 $
Author:
Thomas Weber

Method Summary
 void createNewFile(VirtualFile file)
          creates a new file in the underlying file system.
 boolean delete(java.net.URI uri)
          deletes the file at the given URI.
 boolean delete(VirtualFile file)
          deletes the given VirtualFile.
 boolean distribute(VirtualFile f)
          distributes the VirtualFile.
 long getFileSize(VirtualFile file)
          returns the size of the VirtualFile in bytes.
 java.net.URI getHttpBasePath()
          access to the HTTP base path.
 java.lang.String getHttpBasePathString()
          returns the HTTP base path as a string.
 java.io.InputStream getInputStream(VirtualFile file)
          provides an InputStream to read from the given VirtualFile.
 java.io.OutputStream getOutputStream(VirtualFile file)
          provides an OutputStream to write to the given VirtualFile.
 void init(org.jdom.Element conf)
          initialises the provider with the configuration element.
 boolean mkdir(VirtualFile dir)
          creates a new directory in the underlying file system.
 java.net.URI resolveHTTPPath(VirtualFile file)
          resolves the HTTP path to the given VirtualFile.
 

Method Detail

delete

boolean delete(VirtualFile file)
deletes the given VirtualFile.

Parameters:
file - the VirtualFile to be deleted
Returns:
true, if successful. Otherwise false.

delete

boolean delete(java.net.URI uri)
deletes the file at the given URI. Is used during to move process.

Parameters:
uri - the URI
Returns:
true, if the file could be deleted on the underlying file system or if no such file exists. Otherwise false.

distribute

boolean distribute(VirtualFile f)
distributes the VirtualFile.

Parameters:
f - the VirtualFile to be distributed
Returns:
true if the distribution has been successful; otherwise false

getOutputStream

java.io.OutputStream getOutputStream(VirtualFile file)
                                     throws java.io.IOException
provides an OutputStream to write to the given VirtualFile.

Parameters:
file - the VirtualFile to be written to
Returns:
an OutputStream to write to the given VirtualFile
Throws:
java.io.IOException - on errors aquiring the OutputStream

getInputStream

java.io.InputStream getInputStream(VirtualFile file)
                                   throws java.io.IOException
provides an InputStream to read from the given VirtualFile.

Parameters:
file - the VirtualFile to be read
Returns:
an InputStream to read from the given VirtualFile
Throws:
java.io.IOException - on errors aquiring the InputStream

resolveHTTPPath

java.net.URI resolveHTTPPath(VirtualFile file)
resolves the HTTP path to the given VirtualFile.

Parameters:
file - the VirtualFile to be resolved
Returns:
the URI to the VirtualFile or null, if the VirtualFile is private

getHttpBasePath

java.net.URI getHttpBasePath()
access to the HTTP base path.

Returns:
the HTTP base path

getHttpBasePathString

java.lang.String getHttpBasePathString()
returns the HTTP base path as a string.

Returns:
the HTTP base path as a string

getFileSize

long getFileSize(VirtualFile file)
returns the size of the VirtualFile in bytes.

Parameters:
file - the VirtualFile
Returns:
the size of the VirtualFile in bytes

init

void init(org.jdom.Element conf)
initialises the provider with the configuration element.

Parameters:
conf - the configuration

createNewFile

void createNewFile(VirtualFile file)
                   throws java.io.IOException
creates a new file in the underlying file system.

Parameters:
file - the file to create
Throws:
java.io.IOException - on errors creating the file in the underlying file system

mkdir

boolean mkdir(VirtualFile dir)
creates a new directory in the underlying file system.

Parameters:
dir - the directory to be created
Returns:
true, if and only if the directory has been created