Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ru.biosoft.access
Class FileCollection

    java.lang.Object
      ru.biosoft.access.DataElementSupport
          ru.biosoft.access.AbstractDataCollection
              ru.biosoft.access.VectorDataCollection
                  ru.biosoft.access.FileCollection

All Implemented Interfaces:
  DataCollection, DataElement

public class FileCollection
extends VectorDataCollection

FileCollection is `DataCollection` for storing `FileDataElement` objects . This data collection is storage for files of corresponding subdirectory

Field Summary
`static java.lang.String` | `FILE_FILTER` Property for storing filter file extension
`protected java.io.FileFilter` | `filter` FileFilter is used to select needed files from root directory as well as to check added filed .
`protected java.io.File` | `root` Subdirectory corresponded with this collection.

Fields inherited from class ru.biosoft.access.VectorDataCollection
`INITIAL_SIZE, vector`

Fields inherited from class ru.biosoft.access.AbstractDataCollection
`cat, info, notificationEnabled, path, propagationEnabled, v_cache`

Fields inherited from interface ru.biosoft.access.DataCollection
`CHILDREN_NODE_IMAGE, CHILDREN_NODE_VISIBLE, CLASS_PROPERTY, CLASSPATH_JAR_PROPERTY, COMPARATOR_OBJECT, CONFIG_FILE_PROPERTY, CONFIG_PATH_PROPERTY, DATA_ELEMENT_CLASS_PROPERTY, DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_SUFFIX, DEFAULT_FILTER_CONFIG_SUFFIX, DEFAULT_FORMAT_CONFIG_SUFFIX, DEFAULT_NODE_CONFIG_SUFFIX, DEFAULT_REPOSITORY, DESCRIPTION_PROPERTY, DISPLAY_NAME_PROPERTY, FILE_PATH_PROPERTY, FILE_PROPERTY, FILTER_PROPERTY, ID_FORMAT, IS_ROOT, JOB_CONTROL_PROPERTY, LATE_CHILDREN_INITIALIZATION, MUTABLE, NAME_PROPERTY, NEXT_CONFIG, NODE_IMAGE, NODE_VISIBLE, PRIMARY_COLLECTION, REMOVE_CHILDREN, TRANSFORMER_CLASS`

Constructor Summary
`FileCollection(DataCollection parent, java.util.Properties properties)` Constructs data collection with parent.

Method Summary
`void` | `close()` Removes all of the elements from this data collection.
`protected void` | `doPut(DataElement dataElement, boolean isNew)` Puts FileDataElement to the collection .
`protected void` | `doRemove(java.lang.String name)` Removes FileDataElement element from collection, and removes corresponding file in subdirectory.
`java.lang.Class` | `getDataElementType()` Returns `FileDataElement.class`
`java.io.File` | `getFile()`
`protected void` | `init(java.util.Properties properties)` Initialize file collection from the properties.

Methods inherited from class ru.biosoft.access.VectorDataCollection
`doGet, getAt, getNameList, getSize, iterator, put, toArray`

Methods inherited from class ru.biosoft.access.AbstractDataCollection
`addDataCollectionListener, cachePut, checkMutable, contains, contains, doAddPostNotify, doAddPreNotify, doRemovePostNotify, doRemovePreNotify, finalize, fireElementAdded, fireElementChanged, fireElementRemoved, fireElementWillAdd, fireElementWillChange, fireElementWillRemove, get, getCompleteName, getDescription, getInfo, initLog, isMutable, isNotificationEnabled, isPropagationEnabled, makeInfo, propagateElementChanged, propagateElementWillChange, registerRoot, release, remove, removeDataCollectionListener, setNotificationEnabled, setPropagationEnabled, toString`

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

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface ru.biosoft.access.DataElement
`getName, getOrigin`

Field Detail

### FILE_FILTER

    public static final java.lang.String FILE_FILTER

  Property for storing filter file extension

  See Also:
    Constant Field Values

### root

    protected java.io.File root

  Subdirectory corresponded with this collection.

### filter

    protected java.io.FileFilter filter

  FileFilter is used to select needed files from root directory as well as to check added filed .

  See Also:
    `#doPut(DataElement )`

Constructor Detail

### FileCollection

    public FileCollection(DataCollection parent,
                          java.util.Properties properties)
                   throws java.io.IOException

  Constructs data collection with parent. Makes info for this data collection.
  Required properties
  - `DataCollection.NAME_PROPERTY`
  - `ru.biosoft.access.DataCollection#PATH_PROPERTY`
  Optional properties
  - `FILE_FILTER`
  - `DataCollection.NODE_IMAGE`
  - `DataCollection.CHILDREN_NODE_IMAGE`
  - `DataCollection.NODE_VISIBLE`
  - `DataCollection.CHILDREN_NODE_VISIBLE`

Parameters:
  `parent` - Parent data collection.
  `properties` - Properties for creating data collection .

Method Detail

### close

    public void close()
               throws java.lang.Exception

  Description copied from class: `VectorDataCollection`
  Removes all of the elements from this data collection.

  Specified by:
    `close` in interface `DataCollection`
  Overrides:
    `close` in class `VectorDataCollection`
  Throws:
    `java.lang.Exception`

### init

    protected void init(java.util.Properties properties)

  Initialize file collection from the properties.

  Throws:
    `ChainRuntimeException` - If error occurs.

### getDataElementType

    public java.lang.Class getDataElementType()

  Returns `FileDataElement.class`

  Specified by:
    `getDataElementType` in interface `DataCollection`
  Overrides:
    `getDataElementType` in class `AbstractDataCollection`
  Returns:
    `FileDataElement.class`

### doPut

    protected void doPut(DataElement dataElement,
                         boolean isNew)
                  throws java.lang.Exception

  Puts FileDataElement to the collection .

  Overrides:
    `doPut` in class `VectorDataCollection`
  Parameters:
    `dataElement` - FileDataElement object
    `isNew` - indicates whether this dataElement is new.
  Throws:
    `java.lang.Exception` - If current filter does not accept file (has other extension) .
  See Also:
    `AbstractDataCollection.put(DataElement)`

### getFile

    public java.io.File getFile()

### doRemove

    protected void doRemove(java.lang.String name)
                     throws java.lang.Exception

  Removes FileDataElement element from collection, and removes corresponding file in subdirectory.

  Overrides:
    `doRemove` in class `VectorDataCollection`
  Throws:
    `java.lang.Exception` - If removal is not successful.
  See Also:
    `AbstractDataCollection.remove(String)`

Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2003 Biosof.Ru. All Rights Reserved.