com.mkdoc.store
Class AbstractFileSystemManager

java.lang.Object
  extended bycom.mkdoc.store.AbstractFileSystemManager
Direct Known Subclasses:
AbstractRepositoryManager, HtmlFileSystemSubjectManager, TripleFileSystemSubjectManager

public abstract class AbstractFileSystemManager
extends java.lang.Object

Common methods for managing file system resources.

Version:
0.3 2005-05-12
Author:
Philip Shaw

Field Summary
static java.lang.String ABSOLUTE
          The absolute file path property name.
protected  java.io.File baseDir
          The base output directory.
static java.lang.String DOT
          The default output folder.
static java.lang.String FOLDER
          The output file path property name.
protected  java.io.File outputDir
          The current output directory.
 
Constructor Summary
AbstractFileSystemManager()
           
 
Method Summary
protected  java.lang.String configureOutput(net.javacoding.jspider.core.util.config.PropertySet propertySet)
          Configure the output directory from the plugin property set.
protected  void createDirectories(java.io.File outFile)
          Create directories above a target output file.
protected abstract  java.lang.String getExtension()
          Get the extension for storage files.
 java.io.OutputStream getOutputStream(java.net.URL subject)
          Issue an output stream to which RDF statements can be passed directly.
protected  java.io.File getStorageFile(java.net.URL subject)
          Get a storage file reference for management.
protected  boolean includesFile(java.net.URL url)
          Check whether a URL includes a file part.
protected  void purgeDocumentFile(java.lang.String subjectUri)
          Purge statements about a document by subject URI.
protected  java.lang.String trimExtension(java.net.URL url)
          Trim any extension part from a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABSOLUTE

public static final java.lang.String ABSOLUTE
The absolute file path property name.

Since:
Version 0.1 2005-04-26
See Also:
Constant Field Values

FOLDER

public static final java.lang.String FOLDER
The output file path property name.

Since:
Version 0.1 2005-04-26
See Also:
Constant Field Values

DOT

public static final java.lang.String DOT
The default output folder.

Since:
Version 0.1 2005-04-26
See Also:
Constant Field Values

outputDir

protected java.io.File outputDir
The current output directory.

Since:
Version 0.1 2005-04-26

baseDir

protected java.io.File baseDir
The base output directory.

Since:
Version 0.1 2005-04-26
Constructor Detail

AbstractFileSystemManager

public AbstractFileSystemManager()
Method Detail

configureOutput

protected final java.lang.String configureOutput(net.javacoding.jspider.core.util.config.PropertySet propertySet)
Configure the output directory from the plugin property set.

Parameters:
propertySet - The property set used to initialise the plugin.
Returns:
A status message giving the path of the output directory.
Since:
Version 0.1 2005-04-26

getOutputStream

public final java.io.OutputStream getOutputStream(java.net.URL subject)
                                           throws StoreException
Issue an output stream to which RDF statements can be passed directly.

Temporary measure to adapt plugin writeFile methods.

Parameters:
subject - The subject of the RDF statements.
Returns:
An output stream on which to write RDF statements.
Throws:
StoreException - If an error occurs with the triple store.
Since:
Version 0.1 2005-04-26

purgeDocumentFile

protected final void purgeDocumentFile(java.lang.String subjectUri)
                                throws StoreException
Purge statements about a document by subject URI.

Parameters:
subjectUri - The URI of the subject document to purge.
Throws:
StoreException - If an error occurs with the triple store.
Since:
Version 0.3 2005-05-12

getExtension

protected abstract java.lang.String getExtension()
Get the extension for storage files.

Returns:
An type-specific file extension.
Since:
Version 0.1 2005-04-26

getStorageFile

protected final java.io.File getStorageFile(java.net.URL subject)
Get a storage file reference for management.

Parameters:
subject - The URL of the subject resource.
Returns:
A reference to the storage file for the URL subject.
Since:
Version 0.1 2005-04-26

createDirectories

protected final void createDirectories(java.io.File outFile)
Create directories above a target output file.

Parameters:
outFile - The target output file reference.
Since:
Version 0.1 2005-04-26

includesFile

protected final boolean includesFile(java.net.URL url)
Check whether a URL includes a file part.

Parameters:
url - The URL to check.
Returns:
true if the part after the last directory separator includes a dot prefixed extension.
Since:
Version 0.1 2005-04-26

trimExtension

protected final java.lang.String trimExtension(java.net.URL url)
Trim any extension part from a URL.

Parameters:
url - The URL to process.
Returns:
The file part of the URL less any "file" extension.
Since:
Version 0.1 2005-04-26