RSE
Release 3.4

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

java.lang.Object
  extended by java.lang.Thread
      extended by org.eclipse.dstore.core.server.SecuredThread
          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, ISchemaExtender

public class UniversalFileSystemMiner
extends Miner

This miner allows for remote file browsing and management.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  ArchiveHandlerManager _archiveHandlerManager
           
protected  HashMap _cancellableThreads
           
static String CLASSNAME
           
protected  String filterString
           
protected  boolean showHidden
           
 
Fields inherited from class org.eclipse.dstore.core.miners.Miner
_commandQueue, _dependencies, _minerData, _minerElement, _minerTransient, _name, _resourceBundle, _value
 
Fields inherited from class org.eclipse.dstore.core.model.Handler
_keepRunning, _waitIncrement
 
Fields inherited from class org.eclipse.dstore.core.server.SecuredThread
_dataStore
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UniversalFileSystemMiner()
           
 
Method Summary
 void extendSchema(DataElement schemaRoot)
           
 void finish()
           
 AbsoluteVirtualPath getAbsoluteVirtualPath(DataElement subject)
           
 AbsoluteVirtualPath getAbsoluteVirtualPath(String path)
           
 ISystemArchiveHandler getArchiveHandlerFor(String archivePath)
           
protected  String getClassificationString(String s)
          Method to obtain the classification string of file or folder.
protected  int getDepth(String s)
          Method to obtain the depth for a search
protected  DataElement getFileElement(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()
           
 DataElement handleCancel(DataElement subject, DataElement status)
           
 DataElement handleCommand(DataElement theElement)
           
 DataElement handleCopy(DataElement targetFolder, DataElement sourceFile, DataElement nameObj, DataElement status)
           
 DataElement handleCreateFile(DataElement subject, DataElement status, String queryType)
          Method to create a new file.
 DataElement handleCreateFolder(DataElement subject, DataElement status, String queryType)
          Method to create a new folder.
 DataElement handleDelete(DataElement subject, DataElement status, boolean refreshDataStore)
          Method to Delete a file or folder.
protected  DataElement handleDownload(DataElement theElement, DataElement status)
          Method to download a file.
 DataElement handleGetOSType(DataElement subject, DataElement status)
          Method to retrieve the OS that the miner is running.
protected  DataElement handleQueryAdvanceProperty(DataElement subject, DataElement status)
          Method to query advance properties.
 DataElement handleQueryAll(DataElement subject, DataElement attributes, DataElement status, String queryType, boolean caseSensitive)
          Method to list the files and folders for a given filter.
 DataElement handleQueryAllArchive(DataElement subject, DataElement attributes, DataElement status, boolean caseSensitive, boolean foldersOnly)
           
protected  DataElement handleQueryBasicProperty(DataElement subject, DataElement status)
          Method to Retrieve properties of the file or folder.
protected  DataElement handleQuerycanWriteProperty(DataElement subject, DataElement status)
          Method to Retrieve canWrite property of the file or folder.
protected  DataElement handleQueryClassName(DataElement subject, DataElement status)
          Retrieve the fully qualified class name (including package) for the specified .class file.
protected  DataElement handleQueryEncoding(DataElement subject, DataElement status)
          Get the system encoding
protected  DataElement handleQueryExists(DataElement subject, DataElement status, String queryType)
          Method to query existence of the file or folder.
 DataElement handleQueryFiles(DataElement subject, DataElement attributes, DataElement status, String queryType, boolean caseSensitive)
          Method to list the files for a given filter.
 DataElement handleQueryFolders(DataElement subject, DataElement attributes, DataElement status, String queryType, boolean caseSensitive)
          Method to list the folders for a given filter.
 DataElement handleQueryGetRemoteObject(DataElement subject, DataElement status, String queryType)
          Method to get remote object
protected  DataElement handleQueryQualifiedClassName(DataElement subject, DataElement status)
          Retrieve the fully qualified class name (including package) for a class file.
 DataElement handleQueryRoots(DataElement subject, DataElement status)
          Method to list the roots.
protected  DataElement handleQueryUnusedPort(DataElement subject, DataElement status)
          Get an unused port number.
 DataElement handleRename(DataElement subject, DataElement status)
          Method to Rename a file or folder.
 DataElement handleSearch(DataElement theElement, DataElement status, String queryType, boolean systemFileNamesCaseSensitive)
          Method to do a search.
 DataElement handleSetLastModified(DataElement subject, DataElement status)
          Method to set LastModified to a file or folder.
 DataElement handleSetReadOnly(DataElement subject, DataElement status)
          Method to set ReadOnly to a file or folder.
protected  void internalQueryAll(DataElement subject, File fileobj, String queryType, String filter, boolean caseSensitive, int inclusion, 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)
           
 DataElement statusCancelled(DataElement status)
          Cancel status.
 DataElement statusDone(DataElement status)
          Complete status.
 void updateCancellableThreads(DataElement command, ICancellableHandler thread)
           
 
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 org.eclipse.dstore.core.server.SecuredThread
start
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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

handleCommand

public DataElement handleCommand(DataElement theElement)
                          throws SystemMessageException
Specified by:
handleCommand in class Miner
Throws:
SystemMessageException
See Also:
Miner.handleCommand(DataElement)

handleSearch

public DataElement handleSearch(DataElement theElement,
                                DataElement status,
                                String queryType,
                                boolean systemFileNamesCaseSensitive)
Method to do a search.


handleCancel

public DataElement handleCancel(DataElement subject,
                                DataElement status)

handleQueryAll

public DataElement handleQueryAll(DataElement subject,
                                  DataElement attributes,
                                  DataElement status,
                                  String queryType,
                                  boolean caseSensitive)
                           throws SystemMessageException
Method to list the files and folders for a given filter.

Throws:
SystemMessageException

internalQueryAll

protected void internalQueryAll(DataElement subject,
                                File fileobj,
                                String queryType,
                                String filter,
                                boolean caseSensitive,
                                int inclusion,
                                DataElement status)

updateCancellableThreads

public void updateCancellableThreads(DataElement command,
                                     ICancellableHandler thread)
Since:
3.2

handleQueryFiles

public DataElement handleQueryFiles(DataElement subject,
                                    DataElement attributes,
                                    DataElement status,
                                    String queryType,
                                    boolean caseSensitive)
                             throws SystemMessageException
Method to list the files for a given filter.

Throws:
SystemMessageException

handleQueryFolders

public DataElement handleQueryFolders(DataElement subject,
                                      DataElement attributes,
                                      DataElement status,
                                      String queryType,
                                      boolean caseSensitive)
                               throws SystemMessageException
Method to list the folders for a given filter.

Throws:
SystemMessageException

handleQueryRoots

public DataElement handleQueryRoots(DataElement subject,
                                    DataElement status)
                             throws SystemMessageException
Method to list the roots.

Throws:
SystemMessageException

handleDelete

public DataElement handleDelete(DataElement subject,
                                DataElement status,
                                boolean refreshDataStore)
Method to Delete a file or folder.


handleRename

public DataElement handleRename(DataElement subject,
                                DataElement status)
Method to Rename a file or folder.


handleCreateFile

public DataElement handleCreateFile(DataElement subject,
                                    DataElement status,
                                    String queryType)
Method to create a new file.


handleCreateFolder

public DataElement handleCreateFolder(DataElement subject,
                                      DataElement status,
                                      String queryType)
Method to create a new folder.


handleSetReadOnly

public DataElement handleSetReadOnly(DataElement subject,
                                     DataElement status)
Method to set ReadOnly to a file or folder.


handleSetLastModified

public DataElement handleSetLastModified(DataElement subject,
                                         DataElement status)
Method to set LastModified to a file or folder.


handleQueryBasicProperty

protected DataElement handleQueryBasicProperty(DataElement subject,
                                               DataElement status)
                                        throws SystemMessageException
Method to Retrieve properties of the file or folder.

Throws:
SystemMessageException

handleQuerycanWriteProperty

protected DataElement handleQuerycanWriteProperty(DataElement subject,
                                                  DataElement status)
Method to Retrieve canWrite property of the file or folder.


handleQueryAdvanceProperty

protected DataElement handleQueryAdvanceProperty(DataElement subject,
                                                 DataElement status)
Method to query advance properties.


handleQueryExists

protected DataElement handleQueryExists(DataElement subject,
                                        DataElement status,
                                        String queryType)
                                 throws SystemMessageException
Method to query existence of the file or folder.

Throws:
SystemMessageException

handleQueryGetRemoteObject

public DataElement handleQueryGetRemoteObject(DataElement subject,
                                              DataElement status,
                                              String queryType)
                                       throws SystemMessageException
Method to get remote object

Throws:
SystemMessageException

getFileElement

protected DataElement getFileElement(DataElement subject,
                                     File file)

getClassificationString

protected String getClassificationString(String s)
Method to obtain the classification 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 DataElement handleDownload(DataElement theElement,
                                     DataElement status)
Method to download a file.


handleQueryEncoding

protected DataElement handleQueryEncoding(DataElement subject,
                                          DataElement status)
Get the system encoding


handleQueryUnusedPort

protected DataElement handleQueryUnusedPort(DataElement subject,
                                            DataElement status)
Get an unused port number.


statusDone

public DataElement statusDone(DataElement status)
Complete status.


statusCancelled

public DataElement statusCancelled(DataElement status)
Cancel status.


load

public void load()
Overrides:
load in class Miner
See Also:
Miner.load()

finish

public void finish()
Overrides:
finish in class Miner

handleQueryClassName

protected DataElement handleQueryClassName(DataElement subject,
                                           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 DataElement handleQueryQualifiedClassName(DataElement subject,
                                                    DataElement status)
Retrieve the fully qualified class name (including package) for a class file.


handleGetOSType

public DataElement handleGetOSType(DataElement subject,
                                   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(DataElement schemaRoot)
See Also:
ISchemaExtender.extendSchema(DataElement)

getAbsoluteVirtualPath

public AbsoluteVirtualPath getAbsoluteVirtualPath(DataElement subject)
Since:
3.0 made private method public

getAbsoluteVirtualPath

public AbsoluteVirtualPath getAbsoluteVirtualPath(String path)

handleQueryAllArchive

public DataElement handleQueryAllArchive(DataElement subject,
                                         DataElement attributes,
                                         DataElement status,
                                         boolean caseSensitive,
                                         boolean foldersOnly)

getArchiveHandlerFor

public ISystemArchiveHandler getArchiveHandlerFor(String archivePath)
                                           throws SystemMessageException
Throws:
SystemMessageException

handleCopy

public DataElement handleCopy(DataElement targetFolder,
                              DataElement sourceFile,
                              DataElement nameObj,
                              DataElement status)

setProperties

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

Throws:
SystemMessageException

setProperties

public String setProperties(VirtualChild fileObj)

setProperties

public String setProperties(File fileObj)
                     throws SystemMessageException
Throws:
SystemMessageException

getVersion

public String getVersion()
Specified by:
getVersion in class Miner

RSE
Release 3.4

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