RSE
Release 2.0

org.eclipse.rse.dstore.universal.miners
Class UniversalFileSystemMiner

java.lang.Object
  extended by java.lang.Thread
      extended by org.eclipse.dstore.core.model.Handler
          extended by org.eclipse.dstore.core.miners.Miner
              extended by org.eclipse.rse.dstore.universal.miners.UniversalFileSystemMiner
All Implemented Interfaces:
Runnable, org.eclipse.dstore.core.model.ISchemaExtender

public class UniversalFileSystemMiner
extends org.eclipse.dstore.core.miners.Miner


Field Summary
protected  ArchiveHandlerManager _archiveHandlerManager
           
protected  HashMap _cancellableThreads
           
static String CLASSNAME
           
protected  String filterString
           
static String MINER_ID
           
protected  boolean showHidden
           
 
Fields inherited from class org.eclipse.dstore.core.miners.Miner
_commandQueue, _dataStore, _dependencies, _minerData, _minerElement, _minerTransient, _name, _resourceBundle, _value
 
Fields inherited from class org.eclipse.dstore.core.model.Handler
_keepRunning, _waitIncrement
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UniversalFileSystemMiner()
           
 
Method Summary
 void deleteDir(File fileObj, org.eclipse.dstore.core.model.DataElement status)
          Delete directory and its children.
protected  void doCopyCommand(String source, String tgt, boolean folderCopy, org.eclipse.dstore.core.model.DataElement status)
           
protected  String enQuote(String s)
          Quote a file name such that it is valid in a shell
 void extendSchema(org.eclipse.dstore.core.model.DataElement schemaRoot)
           
 void finish()
           
 AbsoluteVirtualPath getAbsoluteVirtualPath(String path)
           
 ISystemArchiveHandler getArchiveHandlerFor(String archivePath)
           
protected  String getClassificationString(String s)
          Method to obtain the classificatoin string of file or folder.
protected  int getDepth(String s)
          Method to obtain the depth for a search
protected  org.eclipse.rse.internal.dstore.universal.miners.filesystem.FileClassifier getFileClassifier(org.eclipse.dstore.core.model.DataElement subject)
           
protected  org.eclipse.dstore.core.model.DataElement getFileElement(org.eclipse.dstore.core.model.DataElement subject, File file)
           
protected  String getFilterString(String s)
          Method to obtain the filter string of file or folder.
protected  InputStream getInputStreamForFile(String filename)
           
protected  boolean getShowHiddenFlag(String s)
          Method to obtain the show Hidden flag for file or folder.
 String getVersion()
           
 org.eclipse.dstore.core.model.DataElement handleCancel(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
           
 org.eclipse.dstore.core.model.DataElement handleCommand(org.eclipse.dstore.core.model.DataElement theElement)
           
 org.eclipse.dstore.core.model.DataElement handleCopy(org.eclipse.dstore.core.model.DataElement targetFolder, org.eclipse.dstore.core.model.DataElement sourceFile, org.eclipse.dstore.core.model.DataElement nameObj, org.eclipse.dstore.core.model.DataElement status)
           
 org.eclipse.dstore.core.model.DataElement handleCreateFile(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, String queryType)
          Method to create a new file.
 org.eclipse.dstore.core.model.DataElement handleCreateFolder(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, String queryType)
          Method to create a new folder.
 org.eclipse.dstore.core.model.DataElement handleCreateVirtualFile(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, String type)
           
 org.eclipse.dstore.core.model.DataElement handleCreateVirtualFolder(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, String type)
           
 org.eclipse.dstore.core.model.DataElement handleDelete(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, boolean refreshDataStore)
          Method to Delete a file or folder.
 org.eclipse.dstore.core.model.DataElement handleDeleteFromArchive(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
           
protected  org.eclipse.dstore.core.model.DataElement handleDownload(org.eclipse.dstore.core.model.DataElement theElement, org.eclipse.dstore.core.model.DataElement status)
          Method to download a file.
 org.eclipse.dstore.core.model.DataElement handleGetOSType(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to retrieve the OS that the miner is running.
protected  org.eclipse.dstore.core.model.DataElement handleQueryAdvanceProperty(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to query advance properties.
 org.eclipse.dstore.core.model.DataElement handleQueryAll(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement attributes, org.eclipse.dstore.core.model.DataElement status, String queryType, boolean caseSensitive)
          Method to list the files and folders for a given filter.
 org.eclipse.dstore.core.model.DataElement handleQueryAllArchive(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement attributes, org.eclipse.dstore.core.model.DataElement status, boolean caseSensitive, boolean foldersOnly)
           
protected  org.eclipse.dstore.core.model.DataElement handleQueryBasicProperty(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to Retrieve properties of the file or folder.
protected  org.eclipse.dstore.core.model.DataElement handleQuerycanWriteProperty(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to Retrieve canWrite property of the file or folder.
protected  org.eclipse.dstore.core.model.DataElement handleQueryClassName(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Retrieve the fully qualified class name (including package) for the specified .class file.
protected  org.eclipse.dstore.core.model.DataElement handleQueryEncoding(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Get the system encoding
protected  org.eclipse.dstore.core.model.DataElement handleQueryExists(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, String queryType)
          Method to query existence of the file or folder.
protected  org.eclipse.dstore.core.model.DataElement handleQueryFileClassification(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
           
 org.eclipse.dstore.core.model.DataElement handleQueryFiles(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement attributes, org.eclipse.dstore.core.model.DataElement status, String queryType, boolean caseSensitive)
          Method to list the files for a given filter.
 org.eclipse.dstore.core.model.DataElement handleQueryFolders(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement attributes, org.eclipse.dstore.core.model.DataElement status, String queryType, boolean caseSensitive)
          Method to list the folders for a given filter.
 org.eclipse.dstore.core.model.DataElement handleQueryGetRemoteObject(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status, String queryType)
          Method to get remote object
protected  org.eclipse.dstore.core.model.DataElement handleQueryQualifiedClassName(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Retrieve the fully qualified class name (including package) for a class file.
 org.eclipse.dstore.core.model.DataElement handleQueryRoots(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to list the roots.
protected  org.eclipse.dstore.core.model.DataElement handleQueryUnusedPort(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Get an unused port number.
 org.eclipse.dstore.core.model.DataElement handleRename(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to Rename a file or folder.
 org.eclipse.dstore.core.model.DataElement handleSearch(org.eclipse.dstore.core.model.DataElement theElement, org.eclipse.dstore.core.model.DataElement status, String queryType, boolean fileNamesCaseSensitive)
          Method to do a search.
 org.eclipse.dstore.core.model.DataElement handleSetLastModified(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to set LastModified to a file or folder.
 org.eclipse.dstore.core.model.DataElement handleSetReadOnly(org.eclipse.dstore.core.model.DataElement subject, org.eclipse.dstore.core.model.DataElement status)
          Method to set ReadOnly to a file or folder.
protected  void internalQueryAll(org.eclipse.dstore.core.model.DataElement subject, File fileobj, String queryType, String filter, boolean caseSensitive, int inclusion, org.eclipse.dstore.core.model.DataElement status)
           
 void load()
           
 String setProperties(File fileObj)
           
 String setProperties(File fileObj, boolean doArchiveProperties)
          Method to obtain the properties of file or folder.
 String setProperties(VirtualChild fileObj)
           
 org.eclipse.dstore.core.model.DataElement statusCancelled(org.eclipse.dstore.core.model.DataElement status)
          Cancel status.
 org.eclipse.dstore.core.model.DataElement statusDone(org.eclipse.dstore.core.model.DataElement status)
          Complete status.
 
Methods inherited from class org.eclipse.dstore.core.miners.Miner
command, createAbstractCommandDescriptor, createAbstractObjectDescriptor, createAbstractObjectDescriptor, createAbstractRelationship, createCommandDescriptor, createCommandDescriptor, createObjectDescriptor, createObjectDescriptor, createReference, createRelationDescriptor, getCommandArgument, getCommandName, getCommandStatus, getDependencies, getExternalLoader, getMinerData, getMinerDependencies, getMinerElement, getMinerName, getMinerTransient, getNumberOfCommandArguments, getResourceBundle, getSchemaRoot, getValue, handle, initMiner, isConnected, isInitialized, load, makeTransient, requestCommand, setDataStore, setExternalLoader, updateMinerInfo, waitForInput
 
Methods inherited from class org.eclipse.dstore.core.model.Handler
getWaitTime, isFinished, notifyInput, run, setWaitTime
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MINER_ID

public static final String MINER_ID

filterString

protected String filterString

_archiveHandlerManager

protected ArchiveHandlerManager _archiveHandlerManager

showHidden

protected boolean showHidden

CLASSNAME

public static final String CLASSNAME
See Also:
Constant Field Values

_cancellableThreads

protected HashMap _cancellableThreads
Constructor Detail

UniversalFileSystemMiner

public UniversalFileSystemMiner()
Method Detail

getFileClassifier

protected org.eclipse.rse.internal.dstore.universal.miners.filesystem.FileClassifier getFileClassifier(org.eclipse.dstore.core.model.DataElement subject)

handleCommand

public org.eclipse.dstore.core.model.DataElement handleCommand(org.eclipse.dstore.core.model.DataElement theElement)
Specified by:
handleCommand in class org.eclipse.dstore.core.miners.Miner
See Also:
Miner.handleCommand(DataElement)

doCopyCommand

protected void doCopyCommand(String source,
                             String tgt,
                             boolean folderCopy,
                             org.eclipse.dstore.core.model.DataElement status)

deleteDir

public void deleteDir(File fileObj,
                      org.eclipse.dstore.core.model.DataElement status)
Delete directory and its children.


handleSearch

public org.eclipse.dstore.core.model.DataElement handleSearch(org.eclipse.dstore.core.model.DataElement theElement,
                                                              org.eclipse.dstore.core.model.DataElement status,
                                                              String queryType,
                                                              boolean fileNamesCaseSensitive)
Method to do a search.


handleCancel

public org.eclipse.dstore.core.model.DataElement handleCancel(org.eclipse.dstore.core.model.DataElement subject,
                                                              org.eclipse.dstore.core.model.DataElement status)

handleQueryAll

public org.eclipse.dstore.core.model.DataElement handleQueryAll(org.eclipse.dstore.core.model.DataElement subject,
                                                                org.eclipse.dstore.core.model.DataElement attributes,
                                                                org.eclipse.dstore.core.model.DataElement status,
                                                                String queryType,
                                                                boolean caseSensitive)
Method to list the files and folders for a given filter.


internalQueryAll

protected void internalQueryAll(org.eclipse.dstore.core.model.DataElement subject,
                                File fileobj,
                                String queryType,
                                String filter,
                                boolean caseSensitive,
                                int inclusion,
                                org.eclipse.dstore.core.model.DataElement status)

handleQueryFiles

public org.eclipse.dstore.core.model.DataElement handleQueryFiles(org.eclipse.dstore.core.model.DataElement subject,
                                                                  org.eclipse.dstore.core.model.DataElement attributes,
                                                                  org.eclipse.dstore.core.model.DataElement status,
                                                                  String queryType,
                                                                  boolean caseSensitive)
Method to list the files for a given filter.


handleQueryFolders

public org.eclipse.dstore.core.model.DataElement handleQueryFolders(org.eclipse.dstore.core.model.DataElement subject,
                                                                    org.eclipse.dstore.core.model.DataElement attributes,
                                                                    org.eclipse.dstore.core.model.DataElement status,
                                                                    String queryType,
                                                                    boolean caseSensitive)
Method to list the folders for a given filter.


handleQueryRoots

public org.eclipse.dstore.core.model.DataElement handleQueryRoots(org.eclipse.dstore.core.model.DataElement subject,
                                                                  org.eclipse.dstore.core.model.DataElement status)
Method to list the roots.


handleDelete

public org.eclipse.dstore.core.model.DataElement handleDelete(org.eclipse.dstore.core.model.DataElement subject,
                                                              org.eclipse.dstore.core.model.DataElement status,
                                                              boolean refreshDataStore)
Method to Delete a file or folder.


handleRename

public org.eclipse.dstore.core.model.DataElement handleRename(org.eclipse.dstore.core.model.DataElement subject,
                                                              org.eclipse.dstore.core.model.DataElement status)
Method to Rename a file or folder.


handleCreateFile

public org.eclipse.dstore.core.model.DataElement handleCreateFile(org.eclipse.dstore.core.model.DataElement subject,
                                                                  org.eclipse.dstore.core.model.DataElement status,
                                                                  String queryType)
Method to create a new file.


handleCreateFolder

public org.eclipse.dstore.core.model.DataElement handleCreateFolder(org.eclipse.dstore.core.model.DataElement subject,
                                                                    org.eclipse.dstore.core.model.DataElement status,
                                                                    String queryType)
Method to create a new folder.


handleSetReadOnly

public org.eclipse.dstore.core.model.DataElement handleSetReadOnly(org.eclipse.dstore.core.model.DataElement subject,
                                                                   org.eclipse.dstore.core.model.DataElement status)
Method to set ReadOnly to a file or folder.


handleSetLastModified

public org.eclipse.dstore.core.model.DataElement handleSetLastModified(org.eclipse.dstore.core.model.DataElement subject,
                                                                       org.eclipse.dstore.core.model.DataElement status)
Method to set LastModified to a file or folder.


handleQueryBasicProperty

protected org.eclipse.dstore.core.model.DataElement handleQueryBasicProperty(org.eclipse.dstore.core.model.DataElement subject,
                                                                             org.eclipse.dstore.core.model.DataElement status)
Method to Retrieve properties of the file or folder.


handleQuerycanWriteProperty

protected org.eclipse.dstore.core.model.DataElement handleQuerycanWriteProperty(org.eclipse.dstore.core.model.DataElement subject,
                                                                                org.eclipse.dstore.core.model.DataElement status)
Method to Retrieve canWrite property of the file or folder.


handleQueryAdvanceProperty

protected org.eclipse.dstore.core.model.DataElement handleQueryAdvanceProperty(org.eclipse.dstore.core.model.DataElement subject,
                                                                               org.eclipse.dstore.core.model.DataElement status)
Method to query advance properties.


handleQueryFileClassification

protected org.eclipse.dstore.core.model.DataElement handleQueryFileClassification(org.eclipse.dstore.core.model.DataElement subject,
                                                                                  org.eclipse.dstore.core.model.DataElement status)

handleQueryExists

protected org.eclipse.dstore.core.model.DataElement handleQueryExists(org.eclipse.dstore.core.model.DataElement subject,
                                                                      org.eclipse.dstore.core.model.DataElement status,
                                                                      String queryType)
Method to query existence of the file or folder.


handleQueryGetRemoteObject

public org.eclipse.dstore.core.model.DataElement handleQueryGetRemoteObject(org.eclipse.dstore.core.model.DataElement subject,
                                                                            org.eclipse.dstore.core.model.DataElement status,
                                                                            String queryType)
Method to get remote object


getFileElement

protected org.eclipse.dstore.core.model.DataElement getFileElement(org.eclipse.dstore.core.model.DataElement subject,
                                                                   File file)

getClassificationString

protected String getClassificationString(String s)
Method to obtain the classificatoin string of file or folder.


getFilterString

protected String getFilterString(String s)
Method to obtain the filter string of file or folder.


getShowHiddenFlag

protected boolean getShowHiddenFlag(String s)
Method to obtain the show Hidden flag for file or folder.


getDepth

protected int getDepth(String s)
Method to obtain the depth for a search


handleDownload

protected org.eclipse.dstore.core.model.DataElement handleDownload(org.eclipse.dstore.core.model.DataElement theElement,
                                                                   org.eclipse.dstore.core.model.DataElement status)
Method to download a file.


handleQueryEncoding

protected org.eclipse.dstore.core.model.DataElement handleQueryEncoding(org.eclipse.dstore.core.model.DataElement subject,
                                                                        org.eclipse.dstore.core.model.DataElement status)
Get the system encoding


handleQueryUnusedPort

protected org.eclipse.dstore.core.model.DataElement handleQueryUnusedPort(org.eclipse.dstore.core.model.DataElement subject,
                                                                          org.eclipse.dstore.core.model.DataElement status)
Get an unused port number.


statusDone

public org.eclipse.dstore.core.model.DataElement statusDone(org.eclipse.dstore.core.model.DataElement status)
Complete status.


statusCancelled

public org.eclipse.dstore.core.model.DataElement statusCancelled(org.eclipse.dstore.core.model.DataElement status)
Cancel status.


load

public void load()
Overrides:
load in class org.eclipse.dstore.core.miners.Miner
See Also:
Miner.load()

finish

public void finish()
Overrides:
finish in class org.eclipse.dstore.core.miners.Miner

handleQueryClassName

protected org.eclipse.dstore.core.model.DataElement handleQueryClassName(org.eclipse.dstore.core.model.DataElement subject,
                                                                         org.eclipse.dstore.core.model.DataElement status)
Retrieve the fully qualified class name (including package) for the specified .class file. This information is required by the distributed debugger.


handleQueryQualifiedClassName

protected org.eclipse.dstore.core.model.DataElement handleQueryQualifiedClassName(org.eclipse.dstore.core.model.DataElement subject,
                                                                                  org.eclipse.dstore.core.model.DataElement status)
Retrieve the fully qualified class name (including package) for a class file.


handleGetOSType

public org.eclipse.dstore.core.model.DataElement handleGetOSType(org.eclipse.dstore.core.model.DataElement subject,
                                                                 org.eclipse.dstore.core.model.DataElement status)
Method to retrieve the OS that the miner is running.


getInputStreamForFile

protected InputStream getInputStreamForFile(String filename)
                                     throws IOException
Throws:
IOException

extendSchema

public void extendSchema(org.eclipse.dstore.core.model.DataElement schemaRoot)
See Also:
ISchemaExtender.extendSchema(DataElement)

getAbsoluteVirtualPath

public AbsoluteVirtualPath getAbsoluteVirtualPath(String path)

handleDeleteFromArchive

public org.eclipse.dstore.core.model.DataElement handleDeleteFromArchive(org.eclipse.dstore.core.model.DataElement subject,
                                                                         org.eclipse.dstore.core.model.DataElement status)

handleQueryAllArchive

public org.eclipse.dstore.core.model.DataElement handleQueryAllArchive(org.eclipse.dstore.core.model.DataElement subject,
                                                                       org.eclipse.dstore.core.model.DataElement attributes,
                                                                       org.eclipse.dstore.core.model.DataElement status,
                                                                       boolean caseSensitive,
                                                                       boolean foldersOnly)

getArchiveHandlerFor

public ISystemArchiveHandler getArchiveHandlerFor(String archivePath)

handleCreateVirtualFile

public org.eclipse.dstore.core.model.DataElement handleCreateVirtualFile(org.eclipse.dstore.core.model.DataElement subject,
                                                                         org.eclipse.dstore.core.model.DataElement status,
                                                                         String type)

handleCreateVirtualFolder

public org.eclipse.dstore.core.model.DataElement handleCreateVirtualFolder(org.eclipse.dstore.core.model.DataElement subject,
                                                                           org.eclipse.dstore.core.model.DataElement status,
                                                                           String type)

handleCopy

public org.eclipse.dstore.core.model.DataElement handleCopy(org.eclipse.dstore.core.model.DataElement targetFolder,
                                                            org.eclipse.dstore.core.model.DataElement sourceFile,
                                                            org.eclipse.dstore.core.model.DataElement nameObj,
                                                            org.eclipse.dstore.core.model.DataElement status)

setProperties

public String setProperties(File fileObj,
                            boolean doArchiveProperties)
Method to obtain the properties of file or folder.


setProperties

public String setProperties(VirtualChild fileObj)

setProperties

public String setProperties(File fileObj)

enQuote

protected String enQuote(String s)
Quote a file name such that it is valid in a shell

Parameters:
s - file name to quote
Returns:
quoted file name

getVersion

public String getVersion()
Specified by:
getVersion in class org.eclipse.dstore.core.miners.Miner

RSE
Release 2.0

Copyright (c) IBM Corporation and others 2000, 2007. All Rights Reserved.