net.ontopia.topicmaps.entry
Class AbstractPathTopicMapSource

java.lang.Object
  extended by net.ontopia.topicmaps.entry.AbstractPathTopicMapSource
All Implemented Interfaces:
java.io.FileFilter, TopicMapSourceIF
Direct Known Subclasses:
AbstractOntopolyTopicMapSource, RDFPathTopicMapSource

public abstract class AbstractPathTopicMapSource
extends java.lang.Object
implements TopicMapSourceIF, java.io.FileFilter

INTERNAL: Abstract class implementing TopicMapSourceIF; locates topic map file references from a given directory on the local file system. Only files that match the given suffix are used.


Field Summary
protected  LocatorIF base_address
           
protected  boolean duplicate_suppression
           
protected  boolean hidden
           
protected  java.lang.String id
           
protected  java.lang.String path
           
protected  java.util.Map<java.lang.String,TopicMapReferenceIF> refmap
           
protected  java.lang.String suffix
           
protected  java.lang.String title
           
 
Constructor Summary
AbstractPathTopicMapSource()
           
AbstractPathTopicMapSource(java.lang.String path, java.io.FileFilter filter)
           
AbstractPathTopicMapSource(java.lang.String path, java.io.FileFilter filter, LocatorIF base_address)
           
AbstractPathTopicMapSource(java.lang.String path, java.lang.String suffix)
           
AbstractPathTopicMapSource(java.lang.String path, java.lang.String suffix, LocatorIF base_address)
           
 
Method Summary
 boolean accept(java.io.File file)
          INTERNAL: A file filter method implementation.
protected  TopicMapReferenceIF createReference(java.net.URL url, java.lang.String id, java.lang.String title)
           
protected abstract  TopicMapReferenceIF createReference(java.net.URL url, java.lang.String id, java.lang.String title, LocatorIF base_address)
           
 TopicMapReferenceIF createTopicMap(java.lang.String name, java.lang.String baseAddress)
          PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.
 LocatorIF getBase()
          INTERNAL: Gets the base locator of the topic maps retrieved from the source.
 java.lang.String getBaseAddress()
          INTERNAL: Gets the base address of the topic maps retrieved from the source.
 boolean getDuplicateSuppression()
          INTERNAL: Gets the duplicate suppression flag.
 java.io.FileFilter getFileFilter()
          INTERNAL: Returns the FileFilter used to in the specified path.
 boolean getHidden()
           
 java.lang.String getId()
          PUBLIC: Gets the id of the source.
 java.lang.String getPath()
          INTERNAL: Gets the path in which the source locates its references.
 java.util.Collection<TopicMapReferenceIF> getReferences()
          PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.
 java.lang.String getSuffix()
          INTERNAL: Gets the file suffix that should be used for filtering.
 java.lang.String getTitle()
          PUBLIC: Gets the title of the source.
 void refresh()
          PUBLIC: Refreshes the collection of references.
protected  java.util.Map refreshFromClasspath()
           
protected  java.util.Map<java.lang.String,TopicMapReferenceIF> refreshFromFilesystem()
           
 void setBase(LocatorIF base_address)
          INTERNAL: Sets the base locator of the topic maps retrieved from the source.
 void setBaseAddress(java.lang.String base_address)
          INTERNAL: Sets the base address of the topic maps retrieved from the source.
 void setDuplicateSuppression(boolean duplicate_suppression)
          INTERNAL: Sets the duplicate suppression flag.
 void setFileFilter(java.io.FileFilter filter)
          INTERNAL: Sets a FileFilter used to filter the files in the specified path.
 void setHidden(boolean hidden)
           
 void setId(java.lang.String id)
          PUBLIC: Sets the id of the source.
 void setPath(java.lang.String path)
          INTERNAL: Sets the path in which the source locates its references.
 void setSuffix(java.lang.String suffix)
          INTERNAL: Sets the file suffix that should be used for filtering.
 void setTitle(java.lang.String title)
          PUBLIC: Sets the title of the source.
 boolean supportsCreate()
          PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.
 boolean supportsDelete()
          PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

title

protected java.lang.String title

path

protected java.lang.String path

suffix

protected java.lang.String suffix

base_address

protected LocatorIF base_address

duplicate_suppression

protected boolean duplicate_suppression

hidden

protected boolean hidden

refmap

protected java.util.Map<java.lang.String,TopicMapReferenceIF> refmap
Constructor Detail

AbstractPathTopicMapSource

public AbstractPathTopicMapSource()

AbstractPathTopicMapSource

public AbstractPathTopicMapSource(java.lang.String path,
                                  java.lang.String suffix)

AbstractPathTopicMapSource

public AbstractPathTopicMapSource(java.lang.String path,
                                  java.io.FileFilter filter)

AbstractPathTopicMapSource

public AbstractPathTopicMapSource(java.lang.String path,
                                  java.lang.String suffix,
                                  LocatorIF base_address)

AbstractPathTopicMapSource

public AbstractPathTopicMapSource(java.lang.String path,
                                  java.io.FileFilter filter,
                                  LocatorIF base_address)
Method Detail

getId

public java.lang.String getId()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the id of the source.

Specified by:
getId in interface TopicMapSourceIF

setId

public void setId(java.lang.String id)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the id of the source. Note that this method is intended for use when the source is used in a TopicMapRepositoryIF. The source should throw an UnsupportedOperationException if it does not support setting the id.

Specified by:
setId in interface TopicMapSourceIF

getTitle

public java.lang.String getTitle()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the title of the source.

Specified by:
getTitle in interface TopicMapSourceIF

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the title of the source.

Specified by:
setTitle in interface TopicMapSourceIF

getPath

public java.lang.String getPath()
INTERNAL: Gets the path in which the source locates its references.


setPath

public void setPath(java.lang.String path)
INTERNAL: Sets the path in which the source locates its references.


getSuffix

public java.lang.String getSuffix()
INTERNAL: Gets the file suffix that should be used for filtering.


setSuffix

public void setSuffix(java.lang.String suffix)
INTERNAL: Sets the file suffix that should be used for filtering.


getBase

public LocatorIF getBase()
INTERNAL: Gets the base locator of the topic maps retrieved from the source.

Since:
1.3.2

setBase

public void setBase(LocatorIF base_address)
INTERNAL: Sets the base locator of the topic maps retrieved from the source.

Since:
1.3.2

getBaseAddress

public java.lang.String getBaseAddress()
INTERNAL: Gets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.

Since:
1.2.5

setBaseAddress

public void setBaseAddress(java.lang.String base_address)
INTERNAL: Sets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.

Since:
1.2.5

getDuplicateSuppression

public boolean getDuplicateSuppression()
INTERNAL: Gets the duplicate suppression flag. If the flag is true duplicate suppression is to be performed when loading the topic maps.

Since:
1.4.2

setDuplicateSuppression

public void setDuplicateSuppression(boolean duplicate_suppression)
INTERNAL: Sets the duplicate suppression flag. If the flag is true duplicate suppression is to be performed when loading the topic maps.

Since:
1.4.2

getReferences

public java.util.Collection<TopicMapReferenceIF> getReferences()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.

Specified by:
getReferences in interface TopicMapSourceIF

supportsCreate

public boolean supportsCreate()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.

Specified by:
supportsCreate in interface TopicMapSourceIF

supportsDelete

public boolean supportsDelete()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.

Specified by:
supportsDelete in interface TopicMapSourceIF

createTopicMap

public TopicMapReferenceIF createTopicMap(java.lang.String name,
                                          java.lang.String baseAddress)
Description copied from interface: TopicMapSourceIF
PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map. The method takes a name and the base address for the topic map to create.

Specified by:
createTopicMap in interface TopicMapSourceIF

refresh

public void refresh()
Description copied from interface: TopicMapSourceIF
PUBLIC: Refreshes the collection of references. This lets the source look at its underlying data source to reflect any changes made since the last refresh.

Specified by:
refresh in interface TopicMapSourceIF

refreshFromFilesystem

protected java.util.Map<java.lang.String,TopicMapReferenceIF> refreshFromFilesystem()

refreshFromClasspath

protected java.util.Map refreshFromClasspath()

createReference

protected TopicMapReferenceIF createReference(java.net.URL url,
                                              java.lang.String id,
                                              java.lang.String title)

createReference

protected abstract TopicMapReferenceIF createReference(java.net.URL url,
                                                       java.lang.String id,
                                                       java.lang.String title,
                                                       LocatorIF base_address)

getFileFilter

public java.io.FileFilter getFileFilter()
INTERNAL: Returns the FileFilter used to in the specified path.

Since:
1.3.4

setFileFilter

public void setFileFilter(java.io.FileFilter filter)
INTERNAL: Sets a FileFilter used to filter the files in the specified path.

Parameters:
filter - a java.io.FileFilter object for filtering the files
Since:
1.3.4

accept

public boolean accept(java.io.File file)
INTERNAL: A file filter method implementation. It accepts a file if it is not a directory and the filename ends with the specified suffix.

Specified by:
accept in interface java.io.FileFilter

getHidden

public boolean getHidden()

setHidden

public void setHidden(boolean hidden)


Copyright © 2000-2012 Ontopia.