peer2me.message
Class FileObject

java.lang.Object
  extended by peer2me.message.FileObject
Direct Known Subclasses:
ReceivedFileObject, SendFileObject

public abstract class FileObject
extends java.lang.Object

Parent class of the two childclasses SendFileObject and ReceivedFileObject A FileObject can be attached to a Message

Author:
Kim Saxlund
See Also:
SendFileObject, ReceivedFileObject, Message

Constructor Summary
FileObject(java.lang.String fullPathToFile)
          A constructor that takes the full path of a file including the file itself as an argument
 
Method Summary
 java.lang.String getFileName()
          Returns the name of the file that is assosiated with this FileObject
 long getFileSize()
          Returns the size of the file that is assosiated with this FileObject
 java.lang.String getFullPathToFile()
          Returns the full path to the file, including the filename
 boolean isAccessGranted()
          Returns true if the user has granted the Midlet access to the filesystem.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileObject

public FileObject(java.lang.String fullPathToFile)
           throws FileNotFoundException
A constructor that takes the full path of a file including the file itself as an argument

Parameters:
fullPathToFile - Must be the full path to a file, for instance: file:///SDCard/images/animal.jpg This method will block when Connector.open(java.lang.String) is called. The Midlet will then automatically ask the user for permission to access the local filesystem. When access is granted, a connection is established.
Throws:
FileNotFoundException - If the file is not found on the local device
Method Detail

getFileName

public java.lang.String getFileName()
Returns the name of the file that is assosiated with this FileObject

Returns:
The name of the file, for instance: animal.jpg

getFileSize

public long getFileSize()
Returns the size of the file that is assosiated with this FileObject

Returns:
The size of the file in bytes

getFullPathToFile

public java.lang.String getFullPathToFile()
Returns the full path to the file, including the filename

Returns:
The path of the file, for instance: file:///SDCard/images/animal.jpg

isAccessGranted

public boolean isAccessGranted()
Returns true if the user has granted the Midlet access to the filesystem. False otherwise

Returns:
True if the user has granted the Midlet access to the filesystem. False otherwise