public class OracleFileEntryHandler extends Object implements FileEntryHandler
OracleJdbcDirectory
directory under Lucene
4.5.
A file entry handler acts as a delegate to the OracleJdbcDirectory
for all "file" level operations. Allows the OracleJdbcDirectory
to be
abstracted from any specific implementation details regarding a file entry,
and have several different file entries for different files or files groups.
Removes file entries from the database by deleting the relevant rows from the
database.Constructor and Description |
---|
OracleFileEntryHandler() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file entry handler.
|
void |
configure(OracleJdbcDirectory directory)
Called after the entry is created (during the
OracleJdbcDirectory
initialization process. |
org.apache.lucene.store.IndexOutput |
createOutput(String name,
org.apache.lucene.store.IOContext context)
Creates an
IndexOutput in order to write the file contents. |
void |
deleteFile(String name)
Deletes the given file name.
|
List<String> |
deleteFiles(List<String> names)
Deletes a list of files.
|
boolean |
fileExists(String name)
Checks if the file exists for the given file name.
|
long |
fileLength(String name)
Returns the length of the file (in bytes).
|
org.apache.lucene.store.IndexInput |
openInput(String name,
org.apache.lucene.store.IOContext context)
Opens an
IndexInput in order to read the file contents. |
public void close() throws IOException
close
in interface FileEntryHandler
IOException
public void configure(OracleJdbcDirectory directory)
OracleJdbcDirectory
initialization process.configure
in interface FileEntryHandler
public org.apache.lucene.store.IndexOutput createOutput(String name, org.apache.lucene.store.IOContext context) throws IOException
IndexOutput
in order to write the file contents.createOutput
in interface FileEntryHandler
name
- The name of the fileIndexOutput
to write the file contentsIOException
public void deleteFile(String name) throws IOException
deleteFile
in interface FileEntryHandler
name
- The name of the file to deleteIOException
public List<String> deleteFiles(List<String> names) throws IOException
deleteFiles
in interface FileEntryHandler
names
- The list of file names to deletenull
if all were deleted)IOException
public boolean fileExists(String name) throws IOException
fileExists
in interface FileEntryHandler
name
- The name of the filetrue
of the file exists, false
if it does not.IOException
public long fileLength(String name) throws IOException
fileLength
in interface FileEntryHandler
name
- The name of the fileIOException
public org.apache.lucene.store.IndexInput openInput(String name, org.apache.lucene.store.IOContext context) throws IOException
IndexInput
in order to read the file contents.openInput
in interface FileEntryHandler
name
- The name of the fileIndexInput
in order to read the file contents.IOException
Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.