org.jmythapi.protocol.response.impl
Class FileStatus

java.lang.Object
  extended by org.jmythapi.impl.AData<E>
      extended by org.jmythapi.protocol.response.impl.AMythResponse<IFileStatus.Props>
          extended by org.jmythapi.protocol.response.impl.FileStatus
All Implemented Interfaces:
Cloneable, IPropertyAware<IFileStatus.Props>, IVersionable, ISendable, IFileStatus, IMythResponse<IFileStatus.Props>

public class FileStatus
extends AMythResponse<IFileStatus.Props>
implements IFileStatus


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jmythapi.protocol.response.IFileStatus
IFileStatus.Props
 
Field Summary
 
Fields inherited from class org.jmythapi.impl.AData
logger, propsClass, protoVersion, respArgs
 
Constructor Summary
FileStatus(IMythPacket packet)
          Constructs a status object from a protocol packet.
FileStatus(ProtocolVersion protoVersion, String... responseArgs)
          Constructs a status object for the given protocol version and response arguments.
 
Method Summary
 boolean fileExists()
          Checks if the queried file exists.
 String getFilePath()
          Gets the full path of queried file.
 Long getFileSize()
          Gets the size of the file in bytes.
 Date getLastModified()
           
static FileStatus valueOf(IMythPacket packet)
          Constructs a new status object from a protocol packet and does some data correction.
static FileStatus valueOf(ProtocolVersion protoVersion, boolean fileExists, String fileName)
           
static FileStatus valueOf(ProtocolVersion protoVersion, String[] args)
           
 
Methods inherited from class org.jmythapi.protocol.response.impl.AMythResponse
checkSize, decodeProperty, encodeProperty, getExpectedSize, getPacket, getProperties, getProperty, getPropertyIndex
 
Methods inherited from class org.jmythapi.impl.AData
clone, equals, getPropertyClass, getPropertyCount, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValueObject, getPropertyValues, getVersionNr, hashCode, init, postProcessArguments, setPropertyValue, setPropertyValue, setPropertyValueObject, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 
Methods inherited from interface org.jmythapi.IPropertyAware
getProperties, getProperty, getPropertyClass, getPropertyCount, getPropertyIndex, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValues, setPropertyValue, setPropertyValue, setPropertyValueObject
 

Constructor Detail

FileStatus

public FileStatus(IMythPacket packet)
Constructs a status object from a protocol packet.

Parameters:
packet - the protocol packet

FileStatus

public FileStatus(ProtocolVersion protoVersion,
                  String... responseArgs)
Constructs a status object for the given protocol version and response arguments.

Parameters:
protoVersion - the protocol version
responseArgs - the response arguments
Method Detail

fileExists

public boolean fileExists()
Description copied from interface: IFileStatus
Checks if the queried file exists.

Specified by:
fileExists in interface IFileStatus
Returns:
true if the queried file exists.

getFilePath

public String getFilePath()
Description copied from interface: IFileStatus
Gets the full path of queried file.

Specified by:
getFilePath in interface IFileStatus
Returns:
the files full path, or null if the file was not found.

getFileSize

public Long getFileSize()
Description copied from interface: IFileStatus
Gets the size of the file in bytes.

Specified by:
getFileSize in interface IFileStatus
Returns:
the file size in bytes.

getLastModified

public Date getLastModified()
Specified by:
getLastModified in interface IFileStatus

valueOf

public static FileStatus valueOf(IMythPacket packet)
Constructs a new status object from a protocol packet and does some data correction.

Parameters:
packet - the protocol packet
Returns:
the created status object

valueOf

public static FileStatus valueOf(ProtocolVersion protoVersion,
                                 String[] args)

valueOf

public static FileStatus valueOf(ProtocolVersion protoVersion,
                                 boolean fileExists,
                                 String fileName)


Copyright © 2008-2013. All Rights Reserved.