Sun Adapter for Batch/FTP

com.stc.eways.batchext
Class LocalFileProviderImpl

java.lang.Object
  extended by com.stc.eways.batchext.LocalFileProviderImpl
All Implemented Interfaces:
LocalFileProvider

public class LocalFileProviderImpl
extends java.lang.Object
implements LocalFileProvider

It is used to expose a group of local file functions.

Version:
cvs revision: $Revision: 1.6 $ Last Modified: $Date: 2008/03/04 03:05:51 $
Author:
Harry Liu

Nested Class Summary
protected  class LocalFileProviderImpl.FileNameFilter
           
 
Field Summary
protected  LocalFileETD etd
           
protected  long maxInitialAppendSize
           
protected static java.lang.String SP_MAX_INITIAL_APPEND_SIZE
           
protected static long SP_MAX_INITIAL_APPEND_SIZE_DEFAULT
           
 
Method Summary
 boolean append(java.lang.String srcFileName, java.lang.String destFileName)
          Append the contents of the source file to the destination file.
 void copy(java.lang.String srcFileName, java.lang.String destFileName)
          Copy the contents of the source file to the destination file.
 void delete(java.lang.String fileName)
          Delete the file.
 com.stc.eways.common.eway.standalone.streaming.FileInputStream getFileInputStream(java.lang.String name)
           
 java.io.FileOutputStream getFileOutputStream(java.lang.String name, boolean append)
           
 LocalFileName getFirstFileName(java.lang.String directory, boolean directoryIsPattern, java.lang.String file, boolean fileIsPattern)
          Get the first file name matching the specified parameters.
 void initialize(LocalFileETD etd)
           
 void mkdir(java.lang.String dirName)
          Create the named directory, returning true if and only if the directory was created; false otherwise.
 void mkdirs(java.lang.String dirName)
          Create the named directory, including any necessary but nonexistent parent directories.
 void rename(java.lang.String srcFileName, java.lang.String destFileName)
          Rename the source file to the destination file.
 boolean reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SP_MAX_INITIAL_APPEND_SIZE

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

SP_MAX_INITIAL_APPEND_SIZE_DEFAULT

protected static final long SP_MAX_INITIAL_APPEND_SIZE_DEFAULT
See Also:
Constant Field Values

etd

protected LocalFileETD etd

maxInitialAppendSize

protected long maxInitialAppendSize
Method Detail

initialize

public void initialize(LocalFileETD etd)
Specified by:
initialize in interface LocalFileProvider

reset

public boolean reset()
Specified by:
reset in interface LocalFileProvider

append

public boolean append(java.lang.String srcFileName,
                      java.lang.String destFileName)
Append the contents of the source file to the destination file. If the destination file does not exist, it is created.

Specified by:
append in interface LocalFileProvider
Parameters:
srcFileName - The full name of source file.
destFileName - The full name of destination file.
Returns:
True if successfully completed, false if not.

copy

public void copy(java.lang.String srcFileName,
                 java.lang.String destFileName)
          throws LocalFileException
Copy the contents of the source file to the destination file. If the destination file does not exist, it is created.

Specified by:
copy in interface LocalFileProvider
Parameters:
srcFileName - The full name of source file.
destFileName - The full name of destination file.
Throws:
LocalFileException

delete

public void delete(java.lang.String fileName)
            throws LocalFileException
Delete the file.

Specified by:
delete in interface LocalFileProvider
Parameters:
fileName - The full file name.
Throws:
LocalFileException

mkdir

public void mkdir(java.lang.String dirName)
           throws LocalFileException
Create the named directory, returning true if and only if the directory was created; false otherwise. See another method mkdirs(String dirName).

Specified by:
mkdir in interface LocalFileProvider
Parameters:
dirName - A valid directory name to be created.
Throws:
LocalFileException

mkdirs

public void mkdirs(java.lang.String dirName)
            throws LocalFileException
Create the named directory, including any necessary but nonexistent parent directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent directories. See another method mkdir(String dirName).

Specified by:
mkdirs in interface LocalFileProvider
Parameters:
dirName - A valid directory name to be created.
Throws:
LocalFileException

rename

public void rename(java.lang.String srcFileName,
                   java.lang.String destFileName)
            throws LocalFileException
Rename the source file to the destination file. Note: When moving or renaming a file, the destination volume must be the same as the source volume.

Specified by:
rename in interface LocalFileProvider
Parameters:
srcFileName - The full name of source file.
destFileName - The full name of destination file.
Throws:
LocalFileException

getFirstFileName

public LocalFileName getFirstFileName(java.lang.String directory,
                                      boolean directoryIsPattern,
                                      java.lang.String file,
                                      boolean fileIsPattern)
Description copied from interface: LocalFileProvider
Get the first file name matching the specified parameters.

Specified by:
getFirstFileName in interface LocalFileProvider
Parameters:
directory - The directory name or RegEx.
file - The file name or RegEx.
Returns:
The file name found or null if none.

getFileInputStream

public com.stc.eways.common.eway.standalone.streaming.FileInputStream getFileInputStream(java.lang.String name)
                                                                                  throws java.io.FileNotFoundException
Specified by:
getFileInputStream in interface LocalFileProvider
Throws:
java.io.FileNotFoundException

getFileOutputStream

public java.io.FileOutputStream getFileOutputStream(java.lang.String name,
                                                    boolean append)
                                             throws java.io.FileNotFoundException,
                                                    LocalFileException
Specified by:
getFileOutputStream in interface LocalFileProvider
Throws:
java.io.FileNotFoundException
LocalFileException

Sun Adapter for Batch/FTP