org.sourcejammer.project.view
Class FileUploader

java.lang.Object
  |
  +--org.sourcejammer.project.view.FileUploader
All Implemented Interfaces:
Uploader

public class FileUploader
extends java.lang.Object
implements Uploader

Title: $FileName: FileUploader.java$

Version:
$VerNum: 2$ $KeyWordsOff: $

This object allows the client to chop up a file into smaller chunks and stream in each chunk in sequence. SOAP client should be able to instantiate and manipulate this object.
Author:
$AuthorName: Rob MacGrogan$

Field Summary
private  long fileUploadID
           
private  java.io.FileOutputStream stream
           
private  boolean streamClosed
           
private  java.io.File tempFile
           
 
Constructor Summary
FileUploader()
          Construct a new FileUploader.
 
Method Summary
private  void closeStream()
          Flushes and closes the output stream.
protected  void finalize()
           
 long getFileUploadID()
          Returns the unique file upload ID.
private  void makeStreamIfNeeded()
          Creates the output stream if it has not already been created.
 long uploadBytes(org.sourcejammer.util.SendBytes by)
          Streams bytes into the FileUploader.
 long uploadFile(org.sourcejammer.util.SendBytes by)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileUploadID

private long fileUploadID

tempFile

private java.io.File tempFile

stream

private java.io.FileOutputStream stream

streamClosed

private boolean streamClosed
Constructor Detail

FileUploader

public FileUploader()
             throws FileSendException
Construct a new FileUploader. Gets and stores file upload ID for this upload. Created temp file object.

Throws:
FileUploadException - if object has trouble writing to server's file system.
FileSendException
Method Detail

getFileUploadID

public long getFileUploadID()
Returns the unique file upload ID. This needs to be passed to MCP check in or add method.

Specified by:
getFileUploadID in interface Uploader

uploadFile

public long uploadFile(org.sourcejammer.util.SendBytes by)
                throws FileSendException
FileSendException

uploadBytes

public long uploadBytes(org.sourcejammer.util.SendBytes by)
                 throws FileSendException
Streams bytes into the FileUploader.

Specified by:
uploadBytes in interface Uploader
Parameters:
by - -- SendBytes object wrapped around bytes..
FileSendException

closeStream

private void closeStream()
                  throws java.io.IOException
Flushes and closes the output stream.

java.io.IOException

makeStreamIfNeeded

private void makeStreamIfNeeded()
                         throws StreamClosedException,
                                java.io.FileNotFoundException
Creates the output stream if it has not already been created.

StreamClosedException
java.io.FileNotFoundException

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable
See Also:
Object.finalize()


Copyright 2003 Soucejammer project.