Package net.ontopia.topicmaps.entry
Class AbstractPathTopicMapSource
java.lang.Object
net.ontopia.topicmaps.entry.AbstractPathTopicMapSource
- All Implemented Interfaces:
FileFilter,AutoCloseable,TopicMapSourceIF
- Direct Known Subclasses:
AbstractOntopolyTopicMapSource,RDFPathTopicMapSource
public abstract class AbstractPathTopicMapSource
extends Object
implements TopicMapSourceIF, 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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPathTopicMapSource(String path, FileFilter filter) AbstractPathTopicMapSource(String path, FileFilter filter, LocatorIF base_address) AbstractPathTopicMapSource(String path, String suffix) AbstractPathTopicMapSource(String path, String suffix, LocatorIF base_address) -
Method Summary
Modifier and TypeMethodDescriptionbooleanINTERNAL: A file filter method implementation.voidclose()PUBLIC: Closes the source by releasing references it holds to e.g.protected TopicMapReferenceIFcreateReference(URL url, String id, String title) protected abstract TopicMapReferenceIFcreateReference(URL url, String id, String title, LocatorIF base_address) createTopicMap(String name, String baseAddress) PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.getBase()INTERNAL: Gets the base locator of the topic maps retrieved from the source.INTERNAL: Gets the base address of the topic maps retrieved from the source.booleanINTERNAL: Gets the duplicate suppression flag.INTERNAL: Returns the FileFilter used to in the specified path.booleangetId()PUBLIC: Gets the id of the source.getPath()INTERNAL: Gets the path in which the source locates its references.PUBLIC: Returns an unmodifiable collection ofTopicMapReferenceIFs found by the topic map source.INTERNAL: Gets the file suffix that should be used for filtering.getTitle()PUBLIC: Gets the title of the source.voidrefresh()PUBLIC: Refreshes the collection of references.protected Mapprotected Map<String,TopicMapReferenceIF> voidINTERNAL: Sets the base locator of the topic maps retrieved from the source.voidsetBaseAddress(String base_address) INTERNAL: Sets the base address of the topic maps retrieved from the source.voidsetDuplicateSuppression(boolean duplicate_suppression) INTERNAL: Sets the duplicate suppression flag.voidsetFileFilter(FileFilter filter) INTERNAL: Sets a FileFilter used to filter the files in the specified path.voidsetHidden(boolean hidden) voidPUBLIC: Sets the id of the source.voidINTERNAL: Sets the path in which the source locates its references.voidINTERNAL: Sets the file suffix that should be used for filtering.voidPUBLIC: Sets the title of the source.booleanPUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.booleanPUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.
-
Field Details
-
id
-
title
-
path
-
suffix
-
base_address
-
duplicate_suppression
protected boolean duplicate_suppression -
refmap
-
-
Constructor Details
-
AbstractPathTopicMapSource
public AbstractPathTopicMapSource() -
AbstractPathTopicMapSource
-
AbstractPathTopicMapSource
-
AbstractPathTopicMapSource
-
AbstractPathTopicMapSource
-
-
Method Details
-
getId
Description copied from interface:TopicMapSourceIFPUBLIC: Gets the id of the source.- Specified by:
getIdin interfaceTopicMapSourceIF
-
setId
Description copied from interface:TopicMapSourceIFPUBLIC: 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 anUnsupportedOperationExceptionif it does not support setting the id.- Specified by:
setIdin interfaceTopicMapSourceIF
-
getTitle
Description copied from interface:TopicMapSourceIFPUBLIC: Gets the title of the source.- Specified by:
getTitlein interfaceTopicMapSourceIF
-
setTitle
Description copied from interface:TopicMapSourceIFPUBLIC: Sets the title of the source.- Specified by:
setTitlein interfaceTopicMapSourceIF
-
getPath
INTERNAL: Gets the path in which the source locates its references. -
setPath
INTERNAL: Sets the path in which the source locates its references. -
getSuffix
INTERNAL: Gets the file suffix that should be used for filtering. -
setSuffix
INTERNAL: Sets the file suffix that should be used for filtering. -
getBase
INTERNAL: Gets the base locator of the topic maps retrieved from the source.- Since:
- 1.3.2
-
setBase
INTERNAL: Sets the base locator of the topic maps retrieved from the source.- Since:
- 1.3.2
-
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
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
Description copied from interface:TopicMapSourceIFPUBLIC: Returns an unmodifiable collection ofTopicMapReferenceIFs found by the topic map source.- Specified by:
getReferencesin interfaceTopicMapSourceIF
-
supportsCreate
public boolean supportsCreate()Description copied from interface:TopicMapSourceIFPUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.- Specified by:
supportsCreatein interfaceTopicMapSourceIF
-
supportsDelete
public boolean supportsDelete()Description copied from interface:TopicMapSourceIFPUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.- Specified by:
supportsDeletein interfaceTopicMapSourceIF
-
createTopicMap
Description copied from interface:TopicMapSourceIFPUBLIC: 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:
createTopicMapin interfaceTopicMapSourceIF
-
refresh
public void refresh()Description copied from interface:TopicMapSourceIFPUBLIC: 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:
refreshin interfaceTopicMapSourceIF
-
close
public void close()Description copied from interface:TopicMapSourceIFPUBLIC: Closes the source by releasing references it holds to e.g. database or file system objects.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTopicMapSourceIF
-
refreshFromFilesystem
-
refreshFromClasspath
-
createReference
-
createReference
protected abstract TopicMapReferenceIF createReference(URL url, String id, String title, LocatorIF base_address) -
getFileFilter
INTERNAL: Returns the FileFilter used to in the specified path.- Since:
- 1.3.4
-
setFileFilter
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
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:
acceptin interfaceFileFilter
-
getHidden
public boolean getHidden() -
setHidden
public void setHidden(boolean hidden)
-