com.rapidminer.repository.local
Class LocalRepository

java.lang.Object
  extended by com.rapidminer.repository.local.SimpleEntry
      extended by com.rapidminer.repository.local.SimpleFolder
          extended by com.rapidminer.repository.local.LocalRepository
All Implemented Interfaces:
Entry, Folder, Repository

public class LocalRepository
extends SimpleFolder
implements Repository

A repository backed by the local file system. Each entry is backed by one or more files.

Author:
Simon Fischer

Field Summary
 
Fields inherited from class com.rapidminer.repository.local.SimpleEntry
PROPERTIES_SUFFIX
 
Fields inherited from interface com.rapidminer.repository.Folder
TYPE_NAME
 
Constructor Summary
LocalRepository(java.lang.String name, java.io.File root)
           
 
Method Summary
 void addRepositoryListener(RepositoryListener l)
           
 org.w3c.dom.Element createXML(org.w3c.dom.Document doc)
          Returns a piece of XML to store the repository in a configuration file.
 void delete()
          Deletes the entry and its contents from the repository.
protected  void fireEntryAdded(Entry newEntry, Folder parent)
           
protected  void fireEntryRemoved(Entry removedEntry, Folder parent, int index)
           
protected  void fireEntryRenamed(Entry entry)
           
 void fireRefreshed(Folder folder)
           
static LocalRepository fromXML(org.w3c.dom.Element element)
           
 java.lang.String getDescription()
          Returns a human readable description.
 java.io.File getFile()
           
 java.lang.String getIconName()
          Returns the icon name for the repository.
 RepositoryLocation getLocation()
          A location, that can be used, e.g. as a parameter in the RepositorySource or which can be used to locate the entry using RepositoryManager#resolve(String).
 java.io.File getRoot()
           
 java.lang.String getState()
          Returns some user readable information about the state of this repository.
 boolean isConfigurable()
          Returns true if the repository is configurable.
 Entry locate(java.lang.String entry)
          This will return the entry if existing or null if it can't be found.
 RepositoryConfigurationPanel makeConfigurationPanel()
           
 void postInstall()
          Called after the repository is added.
 void preRemove()
           
 void removeRepositoryListener(RepositoryListener l)
           
 boolean rename(java.lang.String newName)
          Changes the name of the entry.
 void setRoot(java.io.File root)
           
 boolean shouldSave()
           
 
Methods inherited from class com.rapidminer.repository.local.SimpleFolder
canRefreshChild, containsEntry, createBlobEntry, createFolder, createIOObjectEntry, createProcessEntry, getDataEntries, getSubfolders, getType, isReadOnly, mkdir, move, move, refresh
 
Methods inherited from class com.rapidminer.repository.local.SimpleEntry
getContainingFolder, getCustomActions, getName, getOwner, getProperty, getRepository, putProperty, setRepository, toString, willBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.repository.Folder
canRefreshChild, containsEntry, createBlobEntry, createFolder, createIOObjectEntry, createProcessEntry, getDataEntries, getSubfolders, refresh
 
Methods inherited from interface com.rapidminer.repository.Entry
getContainingFolder, getCustomActions, getName, getOwner, getType, isReadOnly, move, move, willBlock
 

Constructor Detail

LocalRepository

public LocalRepository(java.lang.String name,
                       java.io.File root)
                throws RepositoryException
Throws:
RepositoryException
Method Detail

getRoot

public java.io.File getRoot()

rename

public boolean rename(java.lang.String newName)
Description copied from interface: Entry
Changes the name of the entry. The entry stays in the same folder.

Specified by:
rename in interface Entry
Overrides:
rename in class SimpleFolder

getFile

public java.io.File getFile()
Overrides:
getFile in class SimpleFolder

setRoot

public void setRoot(java.io.File root)

addRepositoryListener

public void addRepositoryListener(RepositoryListener l)
Specified by:
addRepositoryListener in interface Repository

removeRepositoryListener

public void removeRepositoryListener(RepositoryListener l)
Specified by:
removeRepositoryListener in interface Repository

fireEntryRenamed

protected void fireEntryRenamed(Entry entry)

fireEntryAdded

protected void fireEntryAdded(Entry newEntry,
                              Folder parent)

fireRefreshed

public void fireRefreshed(Folder folder)

fireEntryRemoved

protected void fireEntryRemoved(Entry removedEntry,
                                Folder parent,
                                int index)

getDescription

public java.lang.String getDescription()
Description copied from interface: Entry
Returns a human readable description.

Specified by:
getDescription in interface Entry
Overrides:
getDescription in class SimpleFolder

locate

public Entry locate(java.lang.String entry)
             throws RepositoryException
Description copied from interface: Repository
This will return the entry if existing or null if it can't be found.

Specified by:
locate in interface Repository
Throws:
RepositoryException

getLocation

public RepositoryLocation getLocation()
Description copied from interface: Entry
A location, that can be used, e.g. as a parameter in the RepositorySource or which can be used to locate the entry using RepositoryManager#resolve(String).

Specified by:
getLocation in interface Entry
Overrides:
getLocation in class SimpleEntry

getState

public java.lang.String getState()
Description copied from interface: Repository
Returns some user readable information about the state of this repository.

Specified by:
getState in interface Repository

getIconName

public java.lang.String getIconName()
Description copied from interface: Repository
Returns the icon name for the repository.

Specified by:
getIconName in interface Repository

createXML

public org.w3c.dom.Element createXML(org.w3c.dom.Document doc)
Description copied from interface: Repository
Returns a piece of XML to store the repository in a configuration file.

Specified by:
createXML in interface Repository

fromXML

public static LocalRepository fromXML(org.w3c.dom.Element element)
                               throws XMLException,
                                      RepositoryException
Throws:
XMLException
RepositoryException

delete

public void delete()
Description copied from interface: Entry
Deletes the entry and its contents from the repository.

Specified by:
delete in interface Entry
Overrides:
delete in class SimpleFolder

shouldSave

public boolean shouldSave()
Specified by:
shouldSave in interface Repository

postInstall

public void postInstall()
Description copied from interface: Repository
Called after the repository is added. Currently unused, but may be useful. Was once used to fetch JDBC connection entries from remote server.

Specified by:
postInstall in interface Repository

preRemove

public void preRemove()
Specified by:
preRemove in interface Repository

isConfigurable

public boolean isConfigurable()
Description copied from interface: Repository
Returns true if the repository is configurable. In that case,

Specified by:
isConfigurable in interface Repository

makeConfigurationPanel

public RepositoryConfigurationPanel makeConfigurationPanel()
Specified by:
makeConfigurationPanel in interface Repository


Copyright © 2001-2009 by Rapid-I