|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.importing.crawler.file.internal.FileCrawlerServiceImpl
public class FileCrawlerServiceImpl
Default implementation of a FileCrawlerService.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.smila.importing.crawler.file.FileCrawlerService |
|---|
ATTACHMENT_FILE_CONTENT, PROPERTY_FILE_EXTENSION, PROPERTY_FILE_FOLDER, PROPERTY_FILE_LAST_MODIFIED, PROPERTY_FILE_NAME, PROPERTY_FILE_PATH, PROPERTY_FILE_SIZE |
| Constructor Summary | |
|---|---|
FileCrawlerServiceImpl()
|
|
| 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.io.InputStream |
getContent(Record record,
TaskContext taskContext)
get a stream on a content object. |
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 class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileCrawlerServiceImpl()
| Method Detail |
|---|
public java.util.Collection<java.io.File> listFiles(java.io.File directory)
FileCrawlerService
listFiles in interface FileCrawlerServicepublic java.util.Collection<java.io.File> listDirectories(java.io.File directory)
FileCrawlerService
listDirectories in interface FileCrawlerServicepublic java.util.Collection<java.io.File> list(java.io.File directory)
FileCrawlerService
list in interface FileCrawlerService
public Record fileToRecord(java.io.File file,
java.lang.String dataSource,
boolean withContent)
throws java.io.IOException
FileCrawlerService
fileToRecord in interface FileCrawlerServicewithContent - if true fill also content attachment, otherwise not
java.io.IOException
public void addAttachment(Record record,
java.lang.String pathAttribute,
java.lang.String attachmentName)
throws java.io.IOException
FileCrawlerService
addAttachment in interface FileCrawlerServicepathAttribute - name of the attribute containing the path to the fileattachmentName - name with which the attachment is stored in the recor
java.io.IOException
public Record dirToRecord(java.io.File directory,
java.lang.String dataSource)
FileCrawlerService
dirToRecord in interface FileCrawlerService
public java.io.InputStream getContent(Record record,
TaskContext taskContext)
throws ImportingException
ContentFetcher
getContent in interface ContentFetcherrecord - a crawled record describing the content object.taskContext - the TaskContexrt containing job parameters and more
ImportingException - error accessing the content object.public java.util.Set<java.lang.String> getFilePropertyNames()
FileCrawlerService
getFilePropertyNames in interface FileCrawlerService
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||