com.phoenix_int.aserver.types
Class PHXFile

java.lang.Object
  extended by com.phoenix_int.aserver.types.PHXSimpleType
      extended by com.phoenix_int.aserver.types.PHXFile
All Implemented Interfaces:
IPHXType, IPHXType2, IPHXUnits

public class PHXFile
extends PHXSimpleType

Internal data type used for certain types of files. End users should use PHXRawFile to implement file variables in their custom components.

See Also:
PHXSimpleType, PHXRawFile

Constructor Summary
PHXFile()
           
PHXFile(java.lang.String fileName)
           
PHXFile(java.lang.String baseName, java.lang.String name)
           
 
Method Summary
 void fromString(java.lang.String value)
          converts a String representation to the internal value
 void fromString2(PHXStringBuffer value)
          converts a PHXStringBuffer representation to the internal value
 java.lang.String getContents()
          retrieves the contents of the file
 java.lang.String getName()
          retrieves the name of the file
 java.lang.String getNameCoded()
          retrieves the name of the file in coded form (without $variables replaced)
 boolean hasChanged()
          checks to see if the file has changed since the last time getContents() was called
 void markAsRead()
          call this function after you manually get the contents of the file.
 void setBaseName(java.lang.String v)
          sets the base name of the file
 void setName(java.lang.String v)
          sets the name of the file
 void setStringReplacer(PHXStringReplacer r)
          specifies a PHXStringReplacer object for use in forming the full file name.
 java.lang.String toString()
          converts the variable to a string
 PHXStringBuffer toString2()
          converts the variable to a string
 
Methods inherited from class com.phoenix_int.aserver.types.PHXSimpleType
addPropertyChangeListener, getDescription, getEnumTokens, getHasChanged, getUnits, removePropertyChangeListener, setDescription, setHasChanged, setUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHXFile

public PHXFile()

PHXFile

public PHXFile(java.lang.String fileName)

PHXFile

public PHXFile(java.lang.String baseName,
               java.lang.String name)
Method Detail

getName

public java.lang.String getName()
retrieves the name of the file

Returns:
the name of the file

getNameCoded

public java.lang.String getNameCoded()
retrieves the name of the file in coded form (without $variables replaced)

Returns:
the name of the file in coded form

setName

public void setName(java.lang.String v)
sets the name of the file

Parameters:
v - the name

setBaseName

public void setBaseName(java.lang.String v)
sets the base name of the file

Parameters:
v - the name

setStringReplacer

public void setStringReplacer(PHXStringReplacer r)
specifies a PHXStringReplacer object for use in forming the full file name.

Parameters:
r - the string replacer object

getContents

public java.lang.String getContents()
                             throws java.io.IOException
retrieves the contents of the file

Returns:
the contents of the file
Throws:
java.io.IOException

markAsRead

public void markAsRead()
call this function after you manually get the contents of the file. The function records it's name and timestamp for use with the hasChanged() function


hasChanged

public boolean hasChanged()
checks to see if the file has changed since the last time getContents() was called

Returns:
true if the timestamp of the file is new, or if the file name has changed

toString2

public PHXStringBuffer toString2()
converts the variable to a string

Returns:
a PHXStringBuffer representation of the variable

toString

public java.lang.String toString()
converts the variable to a string

Specified by:
toString in interface IPHXType
Overrides:
toString in class java.lang.Object
Returns:
a String representation of the variable

fromString2

public void fromString2(PHXStringBuffer value)
converts a PHXStringBuffer representation to the internal value

Parameters:
value - the value to convert

fromString

public void fromString(java.lang.String value)
converts a String representation to the internal value

Parameters:
value - the value to convert