DCT Lightfoot v3 API specification

com.dctl.hardware.flash
Class FlashFile

java.lang.Object
  |
  +--com.dctl.hardware.flash.FlashFile

public class FlashFile
extends Object

Provide access to a flash file


Constructor Summary
FlashFile(java.lang.String name)
          Create a new file
 
Method Summary
 boolean createNewFile()
          Create a new file atomically
static FlashFile createTempFile(java.lang.String prefix, java.lang.String suffix)
          Create a temporary file
 boolean delete()
          Delete the file
 boolean equals(FlashFile other)
          Return true if this is equal to another file
 boolean exists()
          Return true if the file exists
static void format()
          Format the flash file system
 java.lang.String getName()
          Get the name of the file
 long length()
          Get the length of the file
static java.lang.String[] list()
          List all the files available
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlashFile

public FlashFile(java.lang.String name)
Create a new file

Parameters:
name - The name
Method Detail

createNewFile

public boolean createNewFile()
                      throws IOException
Create a new file atomically

Returns:
true if the file was created
Throws:
IOException - if there was an error creating it

createTempFile

public static FlashFile createTempFile(java.lang.String prefix,
                                       java.lang.String suffix)
                                throws IOException
Create a temporary file

Parameters:
prefix - The prefix
suffix - The suffix
Returns:
the temporary file
Throws:
IOException - if the file could not be created

delete

public boolean delete()
Delete the file

Returns:
true if the file was deleted, otherwise false

equals

public boolean equals(FlashFile other)
Return true if this is equal to another file

Parameters:
other - The other file
Returns:
true if equals

exists

public boolean exists()
Return true if the file exists

Returns:
true if it exists, otherwise false

getName

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

Returns:
the name

length

public long length()
Get the length of the file

Returns:
the length or 0 if there is a problem, or the file does not exist

list

public static java.lang.String[] list()
List all the files available

Returns:
the files

format

public static void format()
                   throws IOException
Format the flash file system

IOException

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification