SMILA 1.0 API documentation

org.eclipse.smila.importing.crawler.file
Interface FileCrawlerService

All Superinterfaces:
ContentFetcher
All Known Implementing Classes:
FileCrawlerServiceImpl

public interface FileCrawlerService
extends ContentFetcher

Interface for FileCrawlerService.

Author:
stuc07

Field Summary
static java.lang.String ATTACHMENT_FILE_CONTENT
           
static java.lang.String PROPERTY_FILE_EXTENSION
           
static java.lang.String PROPERTY_FILE_FOLDER
           
static java.lang.String PROPERTY_FILE_LAST_MODIFIED
           
static java.lang.String PROPERTY_FILE_NAME
           
static java.lang.String PROPERTY_FILE_PATH
           
static java.lang.String PROPERTY_FILE_SIZE
           
 
Method Summary
 void addAttachment(Record record, java.lang.String pathAttribute, java.lang.String attachmentName)
          Add the content attachment to the given record.
 Record dirToRecord(java.io.File directory, java.lang.String dataSource)
          Create a Record for the given directory and dataSource and fill it with ImportingConstants.ROOT_FOLDER_ATTRIBUTE.
 Record fileToRecord(java.io.File file, java.lang.String dataSource, boolean withContent)
          Create a Record for the given file and dataSource and fill it with all file properties.
 java.util.Set<java.lang.String> getFilePropertyNames()
          Returns a Set containing all file property and attachment names.
 java.util.Collection<java.io.File> list(java.io.File directory)
          List all directories and files of a given directory.
 java.util.Collection<java.io.File> listDirectories(java.io.File directory)
          List all directories of a given directory.
 java.util.Collection<java.io.File> listFiles(java.io.File directory)
          List all files of a given directory.
 
Methods inherited from interface org.eclipse.smila.importing.ContentFetcher
getContent
 

Field Detail

PROPERTY_FILE_NAME

static final java.lang.String PROPERTY_FILE_NAME
See Also:
Constant Field Values

PROPERTY_FILE_PATH

static final java.lang.String PROPERTY_FILE_PATH
See Also:
Constant Field Values

PROPERTY_FILE_FOLDER

static final java.lang.String PROPERTY_FILE_FOLDER
See Also:
Constant Field Values

PROPERTY_FILE_SIZE

static final java.lang.String PROPERTY_FILE_SIZE
See Also:
Constant Field Values

PROPERTY_FILE_LAST_MODIFIED

static final java.lang.String PROPERTY_FILE_LAST_MODIFIED
See Also:
Constant Field Values

PROPERTY_FILE_EXTENSION

static final java.lang.String PROPERTY_FILE_EXTENSION
See Also:
Constant Field Values

ATTACHMENT_FILE_CONTENT

static final java.lang.String ATTACHMENT_FILE_CONTENT
See Also:
Constant Field Values
Method Detail

listFiles

java.util.Collection<java.io.File> listFiles(java.io.File directory)
List all files of a given directory.

Parameters:
directory -
Returns:
a Collection of files

listDirectories

java.util.Collection<java.io.File> listDirectories(java.io.File directory)
List all directories of a given directory.

Parameters:
directory -
Returns:
a Collection of directories

list

java.util.Collection<java.io.File> list(java.io.File directory)
List all directories and files of a given directory.

Parameters:
directory -
Returns:
a Collection of directories and files

fileToRecord

Record fileToRecord(java.io.File file,
                    java.lang.String dataSource,
                    boolean withContent)
                    throws java.io.IOException
Create a Record for the given file and dataSource and fill it with all file properties. Optionally also fill with content attachment.

Parameters:
file -
dataSource -
withContent - if true fill also content attachment, otherwise not
Returns:
a Record
Throws:
java.io.IOException

dirToRecord

Record dirToRecord(java.io.File directory,
                   java.lang.String dataSource)
Create a Record for the given directory and dataSource and fill it with ImportingConstants.ROOT_FOLDER_ATTRIBUTE.

Parameters:
directory -
dataSource -
Returns:
a record

addAttachment

void addAttachment(Record record,
                   java.lang.String pathAttribute,
                   java.lang.String attachmentName)
                   throws java.io.IOException
Add the content attachment to the given record.

Parameters:
record -
pathAttribute - name of the attribute containing the path to the file
attachmentName - name with which the attachment is stored in the recor
Throws:
java.io.IOException

getFilePropertyNames

java.util.Set<java.lang.String> getFilePropertyNames()
Returns a Set containing all file property and attachment names.

Returns:
a Set of String

SMILA 1.0 API documentation