SunSPOT API V3.0


com.sun.spot.peripheral.ota
Class OTAFlashFileInfo

java.lang.Object
  extended by com.sun.spot.peripheral.ota.OTAFlashFileInfo
All Implemented Interfaces:
IFlashFileInfo

public class OTAFlashFileInfo
extends Object
implements IFlashFileInfo

OTAFlashFileInfo records information about a FlashFile instance so that it can be serialised for transmission to a host process.


Constructor Summary
OTAFlashFileInfo(byte[] rawInfo)
          Reconstruct an OTAFlashFileInfo from its serialised representation (see toByteArray()
OTAFlashFileInfo(IFlashFileInfo file)
          Construct a new OTAFlashFileInfo from a FlashFile
OTAFlashFileInfo(String comment, String name, int virtualAddress, boolean isObsolete, long lastModified, int length, boolean exists)
          This constructor is intended for test use only.
 
Method Summary
 String getComment()
          Get the comment for this file
 String getName()
          Get the name of this file
 int getVirtualAddress()
          Get the virtual address of a mapped file
 boolean isObsolete()
          Check whether the file with this name is obsolete
 long lastModified()
          Get the time at which this file was last modified
 int length()
          Get the length of the file with this name
 byte[] toByteArray()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OTAFlashFileInfo

public OTAFlashFileInfo(byte[] rawInfo)
                 throws IOException
Reconstruct an OTAFlashFileInfo from its serialised representation (see toByteArray()

Parameters:
rawInfo -
Throws:
IOException

OTAFlashFileInfo

public OTAFlashFileInfo(IFlashFileInfo file)
                 throws IOException
Construct a new OTAFlashFileInfo from a FlashFile

Parameters:
file - the FlashFile to copy information from
Throws:
IOException

OTAFlashFileInfo

public OTAFlashFileInfo(String comment,
                        String name,
                        int virtualAddress,
                        boolean isObsolete,
                        long lastModified,
                        int length,
                        boolean exists)
This constructor is intended for test use only.

Parameters:
comment -
name -
virtualAddress -
isObsolete -
lastModified -
length -
exists -
Method Detail

getComment

public String getComment()
Description copied from interface: IFlashFileInfo
Get the comment for this file

Specified by:
getComment in interface IFlashFileInfo
Returns:
the comment attached to the file's descriptor
See Also:
IFlashFileInfo.getComment()

isObsolete

public boolean isObsolete()
Description copied from interface: IFlashFileInfo
Check whether the file with this name is obsolete

Specified by:
isObsolete in interface IFlashFileInfo
Returns:
true if this file is marked obsolete, false if it is not
See Also:
IFlashFileInfo.isObsolete()

lastModified

public long lastModified()
Description copied from interface: IFlashFileInfo
Get the time at which this file was last modified

Specified by:
lastModified in interface IFlashFileInfo
Returns:
the time (as returned by System.currentTimeMillis()) at which this file was last modified.
See Also:
IFlashFileInfo.lastModified()

length

public int length()
Description copied from interface: IFlashFileInfo
Get the length of the file with this name

Specified by:
length in interface IFlashFileInfo
Returns:
the length in bytes of the valid portion of the file with this name
See Also:
IFlashFileInfo.length()

getName

public String getName()
Description copied from interface: IFlashFileInfo
Get the name of this file

Specified by:
getName in interface IFlashFileInfo
Returns:
the name of this file
See Also:
IFlashFileInfo.getName()

getVirtualAddress

public int getVirtualAddress()
Description copied from interface: IFlashFileInfo
Get the virtual address of a mapped file

Specified by:
getVirtualAddress in interface IFlashFileInfo
Returns:
the virtual address of the file, or 0 if it is not a mapped file
See Also:
IFlashFileInfo.getVirtualAddress()

toByteArray

public byte[] toByteArray()
                   throws IOException
Returns:
a serialised version of the info for transmission to a host process
Throws:
IOException

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.