|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.syncml.client.FileObject
public class FileObject
This class represents a FileObject which is a file with its meta information
as defined by OMA (see OMA File Data Object Specification for more details).
This class actually stores the meta information, while the actual content is
not part of it. The reason is that in general the content of a file cannot be
kept in memory, so the class could just store a URL or a stream, but at the
moment this is not even supported as this need is not forseen.
Beside storing the file object meta information, this class has also the
ability to parse/format an item (at least its meta info). For this purpose
there are two sets of methods:
parsePrologue, parseEpilogue and parse
formatPrologue and formatEpilogue
Parsing is split between the prologue (everything up to the body content
[escluded]) and the epilogue (everything after the body content). If the
item is known to be small, then it can be parsed in one shot via the parse
method.
Formatting is als split between the prologue and the epilogue
Constructor Summary | |
---|---|
FileObject()
|
Method Summary | |
---|---|
java.lang.String |
formatEpilogue()
Formats the epilogue of this file object. |
java.lang.String |
formatEpilogue(boolean formatBody)
Formats the epilogue of this file object. |
java.lang.String |
formatPrologue()
Formats the prologue of this file object. |
java.lang.String |
formatPrologue(boolean formatBody)
Formats the prologue of this file object. |
java.util.Date |
getAccessed()
Gets the last accessed time |
boolean |
getArchived()
Gets the archived attribute |
java.util.Date |
getCreated()
Gets the creation time |
boolean |
getDeleted()
Gets the deleted attribute |
boolean |
getExecutable()
Gets the executable attribute |
boolean |
getHidden()
Gets the hidden attribute |
java.util.Date |
getModified()
Gets the modification time |
java.lang.String |
getName()
Gets the file name |
boolean |
getReadable()
Gets the readable attribute |
int |
getSize()
Gets the file size. |
boolean |
getSystem()
Gets the system attribute |
boolean |
getWritable()
Gets the writable attribute |
boolean |
isBodyBase64()
Returns true if the body is encoded in base64 (if not it is assumed to be plain text) |
java.lang.String |
parse(java.io.InputStream is)
This method parses a file object which is readable entirely from the input stream. |
void |
parseEpilogue(java.lang.String epilogue)
Parses the epilogue of a file object. |
java.lang.String |
parsePrologue(java.io.InputStream is)
Parses the prologue of a file object. |
void |
setAccessed(java.util.Date accessed)
Sets the last accessed time |
void |
setArchived(boolean a)
Sets the archived attribute |
void |
setCreated(java.util.Date created)
Sets the creation time |
void |
setDeleted(boolean d)
Sets the deleted attribute |
void |
setExecutable(boolean e)
Sets the executable attribute |
void |
setHidden(boolean h)
Sets the hidden attribute |
void |
setModified(java.util.Date modified)
Sets the modification time |
void |
setName(java.lang.String name)
Sets the file name |
void |
setReadable(boolean r)
Sets the readable attribute |
void |
setSize(int size)
Sets the file size |
void |
setSystem(boolean s)
Sets the system attribute |
void |
setWritable(boolean w)
Sets the writable attribute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileObject()
Method Detail |
---|
public void setName(java.lang.String name)
name
- the namepublic java.lang.String getName()
public java.util.Date getModified()
public void setModified(java.util.Date modified)
public void setCreated(java.util.Date created)
public java.util.Date getCreated()
public void setAccessed(java.util.Date accessed)
public java.util.Date getAccessed()
public void setHidden(boolean h)
public boolean getHidden()
public void setSystem(boolean s)
public boolean getSystem()
public void setArchived(boolean a)
public boolean getArchived()
public void setDeleted(boolean d)
public boolean getDeleted()
public void setWritable(boolean w)
public boolean getWritable()
public void setReadable(boolean r)
public boolean getReadable()
public void setExecutable(boolean e)
public boolean getExecutable()
public void setSize(int size)
public int getSize()
public boolean isBodyBase64()
public java.lang.String formatPrologue()
public java.lang.String formatPrologue(boolean formatBody)
formatBody
- specifies if the body tag must be formatted
public java.lang.String formatEpilogue()
public java.lang.String formatEpilogue(boolean formatBody)
formatBody
- specifies if the body tag must be formatted
public java.lang.String parsePrologue(java.io.InputStream is) throws FileObjectException
is
- the input stream representing the input
FileObjectException
- if the parsing fail for any reasonpublic void parseEpilogue(java.lang.String epilogue) throws FileObjectException
FileObjectException
public java.lang.String parse(java.io.InputStream is) throws FileObjectException
is
- the stream from which data is read
FileObjectException
- if any error occurs during the parsing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |