HEADER

ru.biosoft.access
Class LocalRepository

ru.biosoft.access.DataElementSupport
  |
  +--ru.biosoft.access.AbstractDataCollection
        |
        +--ru.biosoft.access.VectorDataCollection
              |
              +--ru.biosoft.access.LocalRepository

public class LocalRepository
extends VectorDataCollection
implements Repository

LocalRepository creates hierarchical DataCollection. The information about used in a tree nodes is extracted from files, which are organized in a tree. In other words each subdirectory contains one DataCollection. DataCollection is described by the special configuration files ("default.config" and *.node.config) It is the standard file of a java.util.Properties . This file contains key-value lines, which describes concrete DataCollection. Key values constants are defined in DataCollection

See Also: java.util.Properties#load(InputStream)
todo sorting order

Field Summary
 final static StringPARENT_COLLECTION
           

Fields inherited from class ru.biosoft.access.VectorDataCollection
INITIAL_SIZE

Constructor Summary
LocalRepository(DataCollection parent, Properties properties)
          Constructs LocalRepository.

Method Summary
 voidclose()
           
 DataCollectioncreateDataCollection(String name, Properties properties, String subDir, String configName, File[] files, boolean copy, CreateDataCollectionController controller)
          Creates new DataCollection with specified subdir (if not null) and config file name.
 StringgetAbsolutePath()
           
 DataElementgetAt(int index)
           
 ClassgetDataElementType()
          Returns DataCollection.class
 ListgetNameList()
           
 FilegetRootDirectory()
           
 intgetSize()
           
 Iteratoriterator()
           

Methods inherited from class ru.biosoft.access.VectorDataCollection
put, toArray

Methods inherited from class ru.biosoft.access.AbstractDataCollection
addDataCollectionListener, contains, contains, get, getCompleteName, getDescription, getInfo, isMutable, isNotificationEnabled, isPropagationEnabled, propagateElementChanged, propagateElementWillChange, release, remove, removeDataCollectionListener, setNotificationEnabled, setPropagationEnabled, toString

Methods inherited from class ru.biosoft.access.DataElementSupport
getName, getOrigin, registerConstructorWithBadEqual

Field Detail

PARENT_COLLECTION

public final static String PARENT_COLLECTION
Constructor Detail

LocalRepository

public LocalRepository(DataCollection parent, Properties properties)
throws java.lang.Exception
Constructs LocalRepository. Root subdirectory is defined by DataCollection#PATH_PROPERTY
Parameters:
parent - parent DataCollection
properties - DataCollection properties
Throws:
Exception - If any error
Method Detail

close

public void close()
throws java.lang.Exception
todo Document

createDataCollection

public DataCollection createDataCollection(String name, Properties properties, String subDir, String configName, File[] files, boolean copy, CreateDataCollectionController controller)
throws java.lang.Exception
Creates new DataCollection with specified subdir (if not null) and config file name. If config file already exists, specified controler is used. If controler permits to override existing config file, then DataCollection is created.
Parameters:
name - DataCollection name
properties - DataCollection properties
subDir - Sub directory for new collection.
configName - Name of configuration file
files - Files to be moved or copied into repository
copy - Indicates whether files should be copied.
controller - Object for special control functions (dialogs for example).
Returns: Created data collection, or null.
Throws:
Exception - If error occured.
todo high Change processing of file overwriting!!!

getAbsolutePath

public String getAbsolutePath()

getAt

public DataElement getAt(int index)

getDataElementType

public Class getDataElementType()
Returns DataCollection.class
Returns: DataCollection.class.

getNameList

public List getNameList()

getRootDirectory

public File getRootDirectory()

getSize

public int getSize()

iterator

public Iterator iterator()

Association Links

to Class java.lang.String

to Class java.io.File

Repository root subdirectory.

FOOTER

BOTTOM