public class FileProcessor extends Object implements IoProcessor, SplitReceiver
| Modifier and Type | Field and Description |
|---|---|
static String |
FILE
FILE.
|
static String |
NAME
NAME.
|
static String |
WILDCARD_PROP
The WILDCARD property.
|
ALPHA_ALG, BACK_ALPHA_ALG, LARGETS_ALG, NEWEST_ALG, OLDEST_ALG, SMALLEST_ALG| Constructor and Description |
|---|
FileProcessor() |
| Modifier and Type | Method and Description |
|---|---|
String |
appendPrefix()
Append this prefix at the beginning of the URL if not present.
|
boolean |
batchDelete(String folder,
String filename,
boolean forceDelete)
Batch delete.
|
void |
connect(String url,
String user,
String password,
boolean passiveMode,
String parameters,
Object request)
Connects to the remote resource.
|
IoStatus |
copy(IoProcessor processor,
String fromFolder,
String toFolder,
String filename,
String toFilename)
Copies fromFolder + filename file to the toFolder + toFilename using
provided destination processor.
|
boolean |
delete(String folder,
String filename)
Deletes a file folder + filename.
|
void |
disconnect()
Disconnects from the remore resource.
|
boolean |
done()
Executed when IO command is finished.
|
void |
dumpOutput(OutputStream outputStream,
String name)
Dumps output stream to the designated destination.
|
boolean |
forceFileExtension()
If true force adding file extension to the name.
|
IoStatus |
get(IoProcessor processor,
String fromFolder,
String toFolder,
String filename)
Copies a file fromFolder + filename to the toFolder + filename using
client as a source IoProcessor.
|
InputStream |
get(Object cData)
Gets the InputStream from the cData.
|
InputStream |
get(String fromFolder,
String filename)
Copies file fromFolder + filename to the InputStream.
|
boolean |
get(String fromFolder,
String toFolder,
String filename)
Copies file fromFolder + filename to the toFolder + filename using itself
as a source IoProcessor.
|
String |
getActualName(String name)
Gets the actual file name from the passed name.
|
List<FileResource> |
getList(String folder,
String filename,
boolean includeFolders,
int maxFiles)
Gets the list of FileResource objects from the folder + filename.
|
String |
getName()
Get processor name.
|
OutputStream |
getOutputStream(String fileName)
Gets the output stream through which data can be written to store a file.
|
String |
getPropsWizardResource()
Gets the name of the xml file used to create a wizard for editing
properties.
|
IoProcessor |
getProxyIoProcessor(String proxyHost,
int proxyPort)
Gets the proxy version of the give io processor.
|
String |
getWildcardAlgorithm()
Gets the wildcard algorithm.
|
boolean |
isApi()
Checks if processor is associated with api.
|
boolean |
isDirect()
Checks if processor gets and saves data directly to the alias.
|
boolean |
isFileSystem()
Checks if IoProcessor operates on a local file system.
|
boolean |
isStreamingProcessor()
Checks if this is a streaming processor.
|
boolean |
isTruncateUrl()
Checks if url needs to be truncated (separated from the file name).
|
int |
maxObjectsInBatch()
Maximum number of objects that can be processed in a single call.
|
boolean |
mkDir(String folder)
Creates a folder.
|
boolean |
move(IoProcessor processor,
String fromFolder,
String toFolder,
String filename,
String toFilename)
Moves a file fromFolder + filename to the toFolder + filename using
processor as a destination IoProcessor.
|
boolean |
preserveUrl()
If true - do not modify the URL when connecting to the resource.
|
boolean |
put(IoProcessor processor,
String fromFolder,
String toFolder,
String filename)
Copies file fromFolder + filename to the toFolder + filename using client
as a designation IoProcessor.
|
IoStatus |
put(String toFolder,
String filename,
InputStream in)
Creates a file toFolder + filename from the InputStream in.
|
boolean |
put(String fromFolder,
String toFolder,
String filename)
Copies a file fromFolder + filename to the toFolder + toFolder using
itself as a destination IoProcessor.
|
int |
rank()
Gets the sorting rank.
|
boolean |
rename(String fromFolder,
String toFolder,
String filename,
String toFilename)
Renames a file fromFolder + filename to toFolder + toFilename.
|
boolean |
supportsCdata()
Checks if IoProcessor supports cdata.
|
boolean |
supportsFiles()
Checks if IoProcessor supports files.
|
public static final String FILE
public static final String NAME
public static final String WILDCARD_PROP
public void connect(String url,
String user,
String password,
boolean passiveMode,
String parameters,
Object request)
throws Exception
IoProcessorconnect in interface IoProcessorurl - the urluser - the userpassword - the passwordpassiveMode - the passive mode flagparameters - the parametersrequest - the requestException - in case of any errorpublic String getWildcardAlgorithm()
IoProcessorgetWildcardAlgorithm in interface IoProcessorpublic IoStatus copy(IoProcessor processor, String fromFolder, String toFolder, String filename, String toFilename) throws Exception
IoProcessorcopy in interface IoProcessorprocessor - the destination IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenametoFilename - the to filenameException - in case of any errorpublic boolean delete(String folder,
String filename)
throws Exception
IoProcessordelete in interface IoProcessorfolder - the folderfilename - the filenameException - in case of any errorpublic void disconnect()
IoProcessordisconnect in interface IoProcessorpublic boolean done()
throws Exception
IoProcessordone in interface IoProcessorException - in case of any errorpublic void dumpOutput(OutputStream outputStream,
String name)
throws Exception
IoProcessordumpOutput in interface IoProcessoroutputStream - the output streamname - the dataset nameException - the exceptionpublic IoStatus get(IoProcessor processor, String fromFolder, String toFolder, String filename) throws Exception
IoProcessorget in interface IoProcessorprocessor - the source IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenameException - in case of any errorpublic InputStream get(String fromFolder,
String filename)
throws Exception
IoProcessorget in interface IoProcessorfromFolder - the from folderfilename - the filenameException - in case of any errorpublic boolean get(String fromFolder,
String toFolder,
String filename)
throws Exception
IoProcessorget in interface IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenameException - in case of any errorpublic List<FileResource> getList(String folder, String filename, boolean includeFolders, int maxFiles) throws Exception
IoProcessorgetList in interface IoProcessorfolder - the folderfilename - the filenameincludeFolders - the include folders flag. If equals to true recursively
includes sub-foldersmaxFiles - the maximum number of filesException - in case of any errorFileResourcepublic String getName()
IoProcessorgetName in interface IoProcessorpublic OutputStream getOutputStream(String fileName)
throws Exception
IoProcessorgetOutputStream in interface IoProcessorfileName - the file nameException - the exceptionpublic String getPropsWizardResource()
IoProcessorgetPropsWizardResource in interface IoProcessorpublic IoProcessor getProxyIoProcessor(String proxyHost, int proxyPort)
IoProcessorgetProxyIoProcessor in interface IoProcessorproxyHost - the proxy urlproxyPort - the proxy portpublic boolean isFileSystem()
IoProcessorisFileSystem in interface IoProcessorpublic boolean isTruncateUrl()
IoProcessorisTruncateUrl in interface IoProcessorpublic boolean mkDir(String folder)
throws Exception
IoProcessormkDir in interface IoProcessorfolder - the folder to createException - in case of any errorpublic boolean move(IoProcessor processor, String fromFolder, String toFolder, String filename, String toFilename) throws Exception
IoProcessormove in interface IoProcessorprocessor - the destination IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenametoFilename - the to filenameException - in case of any errorpublic boolean put(IoProcessor processor, String fromFolder, String toFolder, String filename) throws Exception
IoProcessorput in interface IoProcessorprocessor - the designation IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenameException - in case of any errorpublic IoStatus put(String toFolder, String filename, InputStream in) throws Exception
IoProcessorput in interface IoProcessortoFolder - the to folderfilename - the filenamein - the InputStreamException - in case of any errorpublic boolean put(String fromFolder,
String toFolder,
String filename)
throws Exception
IoProcessorput in interface IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenameException - in case of any errorpublic int rank()
IoProcessorrank in interface IoProcessorpublic boolean rename(String fromFolder,
String toFolder,
String filename,
String toFilename)
throws Exception
IoProcessorrename in interface IoProcessorfromFolder - the from foldertoFolder - the to folderfilename - the filenametoFilename - the to filenameException - in case of any errorpublic boolean supportsCdata()
IoProcessorsupportsCdata in interface IoProcessorpublic boolean supportsFiles()
IoProcessorsupportsFiles in interface IoProcessorpublic boolean isDirect()
IoProcessorisDirect in interface IoProcessorpublic InputStream get(Object cData)
IoProcessorget in interface IoProcessorcData - the cdatapublic boolean forceFileExtension()
IoProcessorforceFileExtension in interface IoProcessorpublic String getActualName(String name)
IoProcessorgetActualName in interface IoProcessorname - Stringpublic boolean isApi()
IoProcessorisApi in interface IoProcessorpublic int maxObjectsInBatch()
IoProcessormaxObjectsInBatch in interface IoProcessorpublic boolean batchDelete(String folder,
String filename,
boolean forceDelete)
throws Exception
IoProcessorbatchDelete in interface IoProcessorfolder - the folderfilename - the filenameforceDelete - if true force the deleteException - in case of any errorpublic boolean isStreamingProcessor()
IoProcessorisStreamingProcessor in interface IoProcessorpublic String appendPrefix()
IoProcessorappendPrefix in interface IoProcessorpublic boolean preserveUrl()
IoProcessorpreserveUrl in interface IoProcessorCopyright © 2010-2020 Toolsverse. All Rights Reserved.