LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyFileValue

java.lang.Object
  extended by leon.data.LyValue
      extended by leon.data.LyFieldInfoValue
          extended by leon.data.LyFileValue

public final class LyFileValue
extends LyFieldInfoValue

This class offers methods for constructing, accessing and modifying values corresponding to a LyFileFieldInfo.

See Also:
LyFileFieldInfo, LyObject

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyFileValue(LyFileFieldInfo fileFieldInfo)
          Constructs an empty file value for the given file field.
LyFileValue(LyFileFieldInfo fileFieldInfo, java.lang.String value)
          Constructs a file value for the given file field from a string.
 
Method Summary
 boolean fetchAttachment(LyObject object)
          Fetch attachment from the peer data provider.
 boolean getBlobContent(LyObject object)
          Fetch blob content from the peer data provider.
 java.io.InputStream getInputStream()
          Gets the InputStream to the underlying value which is a 'File' The attachment handler MUST be "blob", additional FILE fields types may be supported later.
 java.lang.String getLocator()
          Gets the locator of the file when attachment handler is 'blob'.
 LyBlobFileHandler handlerFactory()
          Faftory method to create an instance of a peer handler for attachment.
 void setInputStream(java.io.InputStream iStream)
          Sets the the content of the value which is a 'file'.
 
Methods inherited from class leon.data.LyFieldInfoValue
compare, contains, equals, equals, getFieldInfo, getName, getName, getShortName, getString
 
Methods inherited from class leon.data.LyValue
getField, getValue, isNull, setValue, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyFileValue

public LyFileValue(LyFileFieldInfo fileFieldInfo)
Constructs an empty file value for the given file field.

Parameters:
fileFieldInfo - File fieldInfo for which a value is created.

LyFileValue

public LyFileValue(LyFileFieldInfo fileFieldInfo,
                   java.lang.String value)
Constructs a file value for the given file field from a string.

Parameters:
fileFieldInfo - File fieldInfo for which a value is created.
value - String value as expected by parse method.
See Also:
LyFileFieldInfo.parse(java.lang.String)
Method Detail

handlerFactory

public LyBlobFileHandler handlerFactory()
Faftory method to create an instance of a peer handler for attachment.

See Also:
LyBlobFileHandler

getInputStream

public java.io.InputStream getInputStream()
Gets the InputStream to the underlying value which is a 'File' The attachment handler MUST be "blob", additional FILE fields types may be supported later. The application may be able to read the content of the file. This inputStream is generated from the peer value (by the datasource)

Returns:
the inputstream to read the file or null if it could not be found.

setInputStream

public void setInputStream(java.io.InputStream iStream)
Sets the the content of the value which is a 'file'. The content should be read from the specified InputStream, and is stored in a file or in a blob or in a specific storage depending on the data provider. When the méthod exits, the inputStream is no longer used and may be closed. The attachment handler MUST be "blob", additional FILE fields types may be supported later.

Parameters:
iStream - the inputstream used by the data provider to read the file.

getLocator

public java.lang.String getLocator()
Gets the locator of the file when attachment handler is 'blob'. This is for internal use only since the reference to this locator may change depending on the data provider and File types : use getInputStream and setInputStream instead. This is a mean to fetch the file from the data provider

Returns:
the locator (reference to the file or content in the data provider)
See Also:
getInputStream(), setInputStream()

fetchAttachment

public boolean fetchAttachment(LyObject object)
Fetch attachment from the peer data provider. This methods actually download or get from the blob the target attachment.

Returns:
true if attachment was found, false otherwise

getBlobContent

public boolean getBlobContent(LyObject object)
Fetch blob content from the peer data provider. This methods actually download or get from the blob the peer datasource.

Returns:
true if attachment was found, false otherwise

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com