se.kmr.scam.client.http.helper
Class FileContentBean

java.lang.Object
  extended byse.kmr.scam.client.http.helper.FileContentSupport
      extended byse.kmr.scam.client.http.helper.FileContentBean

public class FileContentBean
extends FileContentSupport

Wrapper/helper for file contents.

Version:
$Revision: 1.7 $
Author:
Jöran
Created:
den 2 december 2002

Field Summary
static String NAME
          Identifier for the UploadBean
 
Constructor Summary
FileContentBean(org.apache.commons.fileupload.FileItem fileItem)
          Constructor for the FileContentBean object that wrapps a FileItem as content provider.
FileContentBean(String manifestId, String uri, long size, String contentType, String shortName)
           
FileContentBean(String internalIdentifier, String contentName, String contentType)
          Constructor for the FileContentBean object that wrapps internal file content.
 
Method Summary
 long getContentSize()
          Gets size of the content.
 String getContentType()
          Gets the contenttype.
 InputStream getInputStream()
          Gets a inputstream to the content
 String getManifestId()
           
 String getRepositoryPath()
          Gets the repositoryPath attribute of the FileContentBean object
 String getRepositoryUri()
          Gets the associated uri
 String getShortFileName()
          Gets the short file name, the original file name.
 String getUri()
           
 void remove()
          Description of the Method
 void write()
          Writes content to repository.
 void write(OutputStream out)
          write content to a stream
 
Methods inherited from class se.kmr.scam.client.http.helper.FileContentSupport
getRepositoryDir, getTempDir, getUriPrefix, setRepositoryDir, setTempDir, setUriPrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Identifier for the UploadBean

See Also:
Constant Field Values
Constructor Detail

FileContentBean

public FileContentBean(org.apache.commons.fileupload.FileItem fileItem)
                throws ServletException
Constructor for the FileContentBean object that wrapps a FileItem as content provider.

Parameters:
fileItem - use this object as content provider
Throws:
ServletException - thrown in case ilegal argument.

FileContentBean

public FileContentBean(String manifestId,
                       String uri,
                       long size,
                       String contentType,
                       String shortName)

FileContentBean

public FileContentBean(String internalIdentifier,
                       String contentName,
                       String contentType)
Constructor for the FileContentBean object that wrapps internal file content.

Parameters:
internalIdentifier - Identifies the internal file
contentName - Original name of the file
contentType - The content type
Method Detail

getRepositoryUri

public String getRepositoryUri()
Gets the associated uri

Returns:
The uri value

getShortFileName

public String getShortFileName()
Gets the short file name, the original file name.

Returns:
The short file name value

getRepositoryPath

public String getRepositoryPath()
Gets the repositoryPath attribute of the FileContentBean object

Returns:
The repositoryPath value

getContentType

public String getContentType()
Gets the contenttype.

Returns:
The contentType value

getContentSize

public long getContentSize()
Gets size of the content.

Returns:
The contentSize value

getManifestId

public String getManifestId()

getUri

public String getUri()

getInputStream

public InputStream getInputStream()
                           throws Exception
Gets a inputstream to the content

Returns:
a inputstream
Throws:
Exception

write

public void write()
           throws Exception
Writes content to repository.

Throws:
Exception - thrown in case of exception writing to repository

write

public void write(OutputStream out)
           throws Exception
write content to a stream

Parameters:
out - write to this stream
Throws:
Exception - thrown in case of exception while writing the content.

remove

public void remove()
Description of the Method



Copyright © 2003 SCAM. All Rights Reserved.