|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenix_int.aserver.types.PHXSimpleType
com.phoenix_int.aserver.types.PHXRawFile
public class PHXRawFile
The Phoenix type for Files. This class has the following properties:
| Constructor Summary | |
|---|---|
PHXRawFile()
|
|
PHXRawFile(java.lang.String fileName)
|
|
PHXRawFile(java.lang.String baseName,
java.lang.String name)
|
|
| Method Summary | |
|---|---|
void |
addMonitor(PHXFileMonitor fm)
PHXFileMonitor is used to monitor changes to a file as it is being created as in the UNIX 'tail -f' command. |
void |
backupFile()
Backup the file on disk. |
void |
backupFile(java.lang.String fileName)
Backup the file on disk. |
void |
deleteFile()
deletes the file from disk |
void |
deleteFile(java.lang.String fileName)
deletes the file from disk |
void |
fromFile()
loads the file from disk |
void |
fromFile(java.lang.String filename)
Sets the filename and then reads from disk. |
void |
fromString(java.lang.String value)
converts a String representation to the internal value |
void |
fromString2(PHXStringBuffer newContents)
|
java.lang.String |
getBaseName()
gets the base name of the file |
java.lang.String |
getContents()
retrieves the contents of the file |
java.lang.String |
getFileExtension()
Returns the extension of the file that this object represents |
boolean |
getIsBinary()
Tells whether or not the the file is binary. |
java.lang.String |
getMimeType()
|
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) |
java.lang.String |
getURL()
Tells whether the file is meant to be transferred by proxy |
java.io.InputStream |
getValueStream()
|
long |
getValueStreamLen()
|
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 |
readFile()
loads the file from disk |
void |
readFile(boolean useDFT)
loads the file from disk |
void |
readFile(java.lang.String filename)
Sets the filename and then reads from disk. |
void |
removeMonitor(PHXFileMonitor fm)
Removes a file monitor from our list |
void |
setBaseName(java.lang.String v)
sets the base name of the file |
void |
setContents(java.lang.String contents)
sets the contents of the file. |
void |
setFileExtension(java.lang.String extension)
Sets the extension of the file that this object represents. |
void |
setIsBinary(boolean m)
Forces this file to be binary or not. |
void |
setMetaData(PHXRawFile metaData)
|
void |
setMimeType(java.lang.String m)
|
void |
setName(java.lang.String v)
sets the name of the file |
void |
setNeedWrite(boolean needWrite)
|
void |
setStringReplacer(PHXStringReplacer r)
specifies a PHXStringReplacer object for use in forming the full file name. |
void |
setURL(java.lang.String url)
sets whether the file is meant to be transferred by proxy or not |
boolean |
synched()
Is this file variable's value consistent with the actual file on disk? |
void |
toFile()
writes the file to disk |
void |
toFile(java.lang.String fileName)
sets the filename and then writes the file to disk. |
java.lang.String |
toString()
converts the variable to a string |
PHXStringBuffer |
toString2()
|
void |
writeFile()
writes the file to disk |
void |
writeFile(java.lang.String fileName)
sets the filename and then writes the file to disk. |
| 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 |
|---|
public PHXRawFile()
public PHXRawFile(java.lang.String fileName)
public PHXRawFile(java.lang.String baseName,
java.lang.String name)
| Method Detail |
|---|
public java.lang.String getName()
public void addMonitor(PHXFileMonitor fm)
public void removeMonitor(PHXFileMonitor fm)
public boolean synched()
public void setNeedWrite(boolean needWrite)
public void setURL(java.lang.String url)
b - is the file to be sent by proxy?public java.lang.String getNameCoded()
public java.lang.String getFileExtension()
public void setFileExtension(java.lang.String extension)
throws java.io.IOException
It is preferred that you use setName() and let the system automatically figure out the extension based on what you pass in. Then, you can use readFile() and writeFile() without passing filenames to those calls. This allows for progress monitoring to work correctly in all cases.
java.io.IOException
public void setName(java.lang.String v)
throws java.io.IOException
v - the name
java.io.IOException
public void setBaseName(java.lang.String v)
throws java.io.IOException
v - the name
java.io.IOExceptionpublic java.lang.String getBaseName()
public void setStringReplacer(PHXStringReplacer r)
r - the string replacer objectpublic boolean getIsBinary()
public java.lang.String getURL()
public void setIsBinary(boolean m)
public java.lang.String getMimeType()
public void setMimeType(java.lang.String m)
public void setContents(java.lang.String contents)
throws java.io.IOException
contents - the contents of the file
java.io.IOException
public java.lang.String getContents()
throws java.io.IOException
java.io.IOException
public void fromFile(java.lang.String filename)
throws java.io.IOException
java.io.IOException - thrown if the file can't be loaded.
public void readFile(java.lang.String filename)
throws java.io.IOException
java.io.IOException - thrown if the file can't be loaded.
public void fromFile()
throws java.io.IOException
java.io.IOException - thrown if the file can't be loaded.
public void readFile(boolean useDFT)
throws java.io.IOException
useDFT - If true, the file won't really be read but instead its
existence will be verified and a flag set.
java.io.IOException - thrown if the file can't be loaded.
public void deleteFile(java.lang.String fileName)
throws java.io.IOException
the - file to delete
java.io.IOExceptionpublic void deleteFile()
public void backupFile(java.lang.String fileName)
throws java.io.IOException
the - file to backup
java.io.IOExceptionpublic void backupFile()
public void readFile()
throws java.io.IOException
java.io.IOException - thrown if the file can't be loaded.public void markAsRead()
public boolean hasChanged()
public void toFile(java.lang.String fileName)
throws java.io.IOException
java.io.IOException - thrown if the file can't be written.
public void writeFile(java.lang.String fileName)
throws java.io.IOException
java.io.IOException - thrown if the file can't be written.
public void toFile()
throws java.io.IOException
java.io.IOException - thrown if the file can't be written.
public void writeFile()
throws java.io.IOException
java.io.IOException - thrown if the file can't be written.
public long getValueStreamLen()
throws java.io.IOException
java.io.IOException
public java.io.InputStream getValueStream()
throws java.io.IOException
java.io.IOException
public PHXStringBuffer toString2()
throws java.io.IOException
toString2 in interface IPHXType2java.io.IOException
public void fromString2(PHXStringBuffer newContents)
throws java.io.IOException,
PHXGetByUrlException
fromString2 in interface IPHXType2java.io.IOException
PHXGetByUrlExceptionpublic java.lang.String toString()
toString in interface IPHXTypetoString in class java.lang.Objectpublic void fromString(java.lang.String value)
fromString in interface IPHXTypevalue - the value to convertpublic void setMetaData(PHXRawFile metaData)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||