org.virtualbox_5_0
Class IFile

java.lang.Object
  extended by org.virtualbox_5_0.IUnknown
      extended by org.virtualbox_5_0.IFile
Direct Known Subclasses:
IGuestFile

public class IFile
extends IUnknown

Abstract parent interface for files handled by VirtualBox. Interface ID: {14C66B23-404C-F24A-3CC1-EE9501D44F2A}


Field Summary
 
Fields inherited from class org.virtualbox_5_0.IUnknown
obj, port
 
Constructor Summary
IFile(java.lang.String wrapped, org.virtualbox_5_0.jaxws.VboxPortType port)
           
 
Method Summary
 void close()
          Closes this file.
 FileAccessMode getAccessMode()
          The file access mode.
 java.lang.Long getCreationMode()
          The UNIX-style creation mode specified when opening the file.
 IEventSource getEventSource()
          Event source for file events.
 java.lang.String getFileName()
          Full path of the actual file name of this file.
 java.lang.Long getId()
          The ID VirtualBox internally assigned to the open file.
 java.lang.Long getInitialSize()
          The initial size in bytes when opened.
 java.lang.Long getOffset()
          The current file position.
 FileOpenAction getOpenAction()
          The opening action specified when opening the file.
 FileStatus getStatus()
          Current file status.
 IFsObjInfo queryInfo()
          Queries information about this file.
static IFile queryInterface(IUnknown obj)
           
 java.lang.Long querySize()
          Queries the current file size.
 byte[] read(java.lang.Long toRead, java.lang.Long timeoutMS)
          Reads data from this file.
 byte[] readAt(java.lang.Long offset, java.lang.Long toRead, java.lang.Long timeoutMS)
          Reads data from an offset of this file.
 java.lang.Long seek(java.lang.Long offset, FileSeekOrigin whence)
          Changes the current file position of this file.
 void setACL(java.lang.String acl, java.lang.Long mode)
          Sets the ACL of this file.
 void setSize(java.lang.Long size)
          Changes the file size.
 java.lang.Long write(byte[] data, java.lang.Long timeoutMS)
          Writes bytes to this file.
 java.lang.Long writeAt(java.lang.Long offset, byte[] data, java.lang.Long timeoutMS)
          Writes bytes at a certain offset to this file.
 
Methods inherited from class org.virtualbox_5_0.IUnknown
getRemoteWSPort, getWrapped, releaseRemote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IFile

public IFile(java.lang.String wrapped,
             org.virtualbox_5_0.jaxws.VboxPortType port)
Method Detail

getEventSource

public IEventSource getEventSource()
Event source for file events.

Returns:
org.virtualbox_5_0.IEventSource

getId

public java.lang.Long getId()
The ID VirtualBox internally assigned to the open file.

Returns:
Long

getInitialSize

public java.lang.Long getInitialSize()
The initial size in bytes when opened.

Returns:
Long

getOffset

public java.lang.Long getOffset()
The current file position. The file current position always applies to theread(Long,Long)method, which updates it upon return. Same goes for thewrite(byte[],Long)method except whengetAccessMode()isFileAccessMode.AppendOnlyorFileAccessMode.AppendRead, where it will always write to the end of the file and will leave this attribute unchanged. Theseek(Long,org.virtualbox_5_0.FileSeekOrigin)is used to change this attribute without transfering any file data like read and write does.

Returns:
Long

getStatus

public FileStatus getStatus()
Current file status.

Returns:
org.virtualbox_5_0.FileStatus

getFileName

public java.lang.String getFileName()
Full path of the actual file name of this file.

Returns:
String

getCreationMode

public java.lang.Long getCreationMode()
The UNIX-style creation mode specified when opening the file.

Returns:
Long

getOpenAction

public FileOpenAction getOpenAction()
The opening action specified when opening the file.

Returns:
org.virtualbox_5_0.FileOpenAction

getAccessMode

public FileAccessMode getAccessMode()
The file access mode.

Returns:
org.virtualbox_5_0.FileAccessMode

queryInterface

public static IFile queryInterface(IUnknown obj)

close

public void close()
Closes this file. After closing operations like reading data, writing data or querying information will not be possible anymore.


queryInfo

public IFsObjInfo queryInfo()
Queries information about this file.

Returns:
Object information of this file. Also seeIFsObjInfo. Expected result codes:
E_NOTIMPLThe method is not implemented yet.

querySize

public java.lang.Long querySize()
Queries the current file size.

Returns:
Queried file size. Expected result codes:
E_NOTIMPLThe method is not implemented yet.

read

public byte[] read(java.lang.Long toRead,
                   java.lang.Long timeoutMS)
Reads data from this file.

Parameters:
toRead - Number of bytes to read.
timeoutMS - Timeout (in ms) to wait for the operation to complete. Pass 0 for an infinite timeout.
Returns:
Array of data read. Expected result codes:
E_NOTIMPLThe method is not implemented yet.

readAt

public byte[] readAt(java.lang.Long offset,
                     java.lang.Long toRead,
                     java.lang.Long timeoutMS)
Reads data from an offset of this file.

Parameters:
offset - Offset in bytes to start reading.
toRead - Number of bytes to read.
timeoutMS - Timeout (in ms) to wait for the operation to complete. Pass 0 for an infinite timeout.
Returns:
Array of data read. Expected result codes:
E_NOTIMPLThe method is not implemented yet.

seek

public java.lang.Long seek(java.lang.Long offset,
                           FileSeekOrigin whence)
Changes the current file position of this file. The file current position always applies to theread(Long,Long)method. Same for thewrite(byte[],Long)method it except when thegetAccessMode()isFileAccessMode.AppendOnlyorFileAccessMode.AppendRead.

Parameters:
offset - Offset to seek relative to the position specified by whence.
whence - One of theFileSeekOriginseek starting points.
Returns:
The new file offset after the seek operation.

setACL

public void setACL(java.lang.String acl,
                   java.lang.Long mode)
Sets the ACL of this file.

Parameters:
acl - The ACL specification string. To-be-defined.
mode - UNIX-style mode mask to use if acl is empty. As mention inIGuestSession.directoryCreate(String,Long,List)this is realized on a best effort basis and the exact behavior depends on the Guest OS. Expected result codes:
E_NOTIMPLThe method is not implemented yet.

setSize

public void setSize(java.lang.Long size)
Changes the file size.

Parameters:
size - The new file size. Expected result codes:
E_NOTIMPLThe method is not implemented yet.

write

public java.lang.Long write(byte[] data,
                            java.lang.Long timeoutMS)
Writes bytes to this file.

Parameters:
data - Array of bytes to write. The size of the array also specifies how much to write.
timeoutMS - Timeout (in ms) to wait for the operation to complete. Pass 0 for an infinite timeout.
Returns:
How much bytes were written.

writeAt

public java.lang.Long writeAt(java.lang.Long offset,
                              byte[] data,
                              java.lang.Long timeoutMS)
Writes bytes at a certain offset to this file.

Parameters:
offset - Offset in bytes to start writing.
data - Array of bytes to write. The size of the array also specifies how much to write.
timeoutMS - Timeout (in ms) to wait for the operation to complete. Pass 0 for an infinite timeout.
Returns:
How much bytes were written. Expected result codes:
E_NOTIMPLThe method is not implemented yet.