WebFlow.RemoteFile
Class RemoteFileImp

WebFlow.RemoteFile.RemoteFileImp

public class RemoteFileImp

RemoteFileImpl implements RemoteFile interface that allows user to manipulate with the remote file


Constructor Summary
RemoteFileImp(org.omg.CORBA.Object peer, java.lang.String msg)
           
 
Method Summary
 void close()
          close previously opened file.
protected  void copy_dir(java.lang.String source, java.lang.String dest)
           
protected  void copy_file(java.lang.String source, java.lang.String dest)
           
 boolean copy(java.lang.String source, java.lang.String dest)
           
 boolean createNewFile(java.lang.String fileName)
          Creates a new file on the server.
 boolean delete(java.lang.String file_name)
           
 boolean exists(java.lang.String file_name)
           
 java.lang.String[] fileList(java.lang.String dir_name)
           
 void get(org.omg.CORBA.ByteHolder c)
          gets one byte from the file and returns it to the user
 byte[] getBlock()
          reads block of bytes from the file and returns it to the user
 int getFileSize()
           
 boolean HtmlTemplate(java.lang.String template, java.lang.String htmlFile, java.lang.String message)
           
 boolean isDirectory(java.lang.String directory_name)
           
 boolean isFile(java.lang.String filename)
           
 boolean mkdir(java.lang.String dir_name)
           
 void open(java.lang.String file_name, java.lang.String options)
          open file specified by user.
 void put(byte c)
          write one byte to the file
 void putBlock(byte[] arr)
          write block of bytes to the file
 boolean rename(java.lang.String source, java.lang.String dest)
           
 boolean rmdir(java.lang.String dir_name)
           
 boolean saveAsFile(java.lang.String filename, java.lang.String body)
           
 void saveIOR(java.lang.String ior, java.lang.String filename)
           
 void setBlockSize(short aSize)
          set block size for reading file
 void test()
           
 

Constructor Detail

RemoteFileImp

public RemoteFileImp(org.omg.CORBA.Object peer,
                     java.lang.String msg)
              throws WebFlow.NullPointerException
Method Detail

open

public void open(java.lang.String file_name,
                 java.lang.String options)
          throws WebFlow.RemoteFile.FileException
open file specified by user.
Parameters:
file_name - name of the file to open

close

public void close()
close previously opened file.

get

public void get(org.omg.CORBA.ByteHolder c)
         throws WebFlow.RemoteFile.FileException,
                WebFlow.RemoteFile.EOFFileException
gets one byte from the file and returns it to the user
Parameters:
c - holds read byte

getBlock

public byte[] getBlock()
                throws WebFlow.RemoteFile.FileException,
                       WebFlow.RemoteFile.EOFFileException
reads block of bytes from the file and returns it to the user
Parameters:
arr - sequence of read bytes. use arr.value.length to determine how many bytes were read.

put

public void put(byte c)
         throws WebFlow.RemoteFile.FileException
write one byte to the file
Parameters:
c - value to be written to the file

putBlock

public void putBlock(byte[] arr)
              throws WebFlow.RemoteFile.FileException
write block of bytes to the file
Parameters:
arr - array of bytes to be written to the file.

setBlockSize

public void setBlockSize(short aSize)
set block size for reading file
Parameters:
aSize - size of the block of octets to be read at one time

getFileSize

public int getFileSize()
                throws WebFlow.RemoteFile.FileException

createNewFile

public boolean createNewFile(java.lang.String fileName)
Creates a new file on the server. Only a simple wrapper for the same method in the File class. The file name should be the complete path name of the new file; i.e. /tmp/newfile.

delete

public boolean delete(java.lang.String file_name)

mkdir

public boolean mkdir(java.lang.String dir_name)

rmdir

public boolean rmdir(java.lang.String dir_name)

rename

public boolean rename(java.lang.String source,
                      java.lang.String dest)

copy_file

protected void copy_file(java.lang.String source,
                         java.lang.String dest)
                  throws WebFlow.RemoteFile.FileException

copy_dir

protected void copy_dir(java.lang.String source,
                        java.lang.String dest)
                 throws WebFlow.RemoteFile.FileException

copy

public boolean copy(java.lang.String source,
                    java.lang.String dest)

exists

public boolean exists(java.lang.String file_name)

isDirectory

public boolean isDirectory(java.lang.String directory_name)

fileList

public java.lang.String[] fileList(java.lang.String dir_name)

isFile

public boolean isFile(java.lang.String filename)

test

public void test()

saveAsFile

public boolean saveAsFile(java.lang.String filename,
                          java.lang.String body)

HtmlTemplate

public boolean HtmlTemplate(java.lang.String template,
                            java.lang.String htmlFile,
                            java.lang.String message)

saveIOR

public void saveIOR(java.lang.String ior,
                    java.lang.String filename)