|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.virtualbox_6_0.IUnknown
org.virtualbox_6_0.IFile
public class IFile
Abstract parent interface for files handled by VirtualBox. Interface ID: {59A235AC-2F1A-4D6C-81FC-E3FA843F49AE}
Field Summary |
---|
Fields inherited from class org.virtualbox_6_0.IUnknown |
---|
obj, objMgr, port |
Constructor Summary | |
---|---|
IFile(java.lang.String wrapped,
org.virtualbox_6_0.ObjectRefManager objMgr,
org.virtualbox_6_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_6_0.IUnknown |
---|
getObjMgr, getRemoteWSPort, getWrapped, releaseRemote |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IFile(java.lang.String wrapped, org.virtualbox_6_0.ObjectRefManager objMgr, org.virtualbox_6_0.jaxws.VboxPortType port)
Method Detail |
---|
public IEventSource getEventSource()
public java.lang.Long getId()
public java.lang.Long getInitialSize()
public java.lang.Long getOffset()
read(Long,Long)
method, which updates it upon return. Same goes for thewrite(byte[],Long)
method except whengetAccessMode()
isFileAccessMode.AppendOnly
orFileAccessMode.AppendRead
, where it will always write
to the end of the file and will leave this attribute unchanged.
Theseek(Long,org.virtualbox_6_0.FileSeekOrigin)
is used to change this attribute without
transfering any file data like read and write does.
NOTE: This will not always be correct with older guest additions
(version 5.2.30 and earlier, as well as versions 6.0.0 thru 6.0.8)
after a callingreadAt(Long,Long,Long)
orwriteAt(Long,byte[],Long)
,
or after callingwrite(byte[],Long)
on a file in append mode.
The correct file offset can be obtained usingseek(Long,org.virtualbox_6_0.FileSeekOrigin)
.
public FileStatus getStatus()
public java.lang.String getFilename()
public java.lang.Long getCreationMode()
public FileOpenAction getOpenAction()
public FileAccessMode getAccessMode()
public static IFile queryInterface(IUnknown obj)
public void close()
public IFsObjInfo queryInfo()
IFsObjInfo
.public java.lang.Long querySize()
public byte[] read(java.lang.Long toRead, java.lang.Long timeoutMS)
getOffset()
) is updated on success.
toRead
- Number of bytes to read.timeoutMS
- Timeout (in ms) to wait for the operation to complete.
Pass 0 for an infinite timeout.
public byte[] readAt(java.lang.Long offset, java.lang.Long toRead, java.lang.Long timeoutMS)
getOffset()
) is updated on success.
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.
public java.lang.Long seek(java.lang.Long offset, FileSeekOrigin whence)
read(Long,Long)
method. Same for thewrite(byte[],Long)
method it except when
thegetAccessMode()
isFileAccessMode.AppendOnly
orFileAccessMode.AppendRead
.
offset
- Offset to seek relative to the position specified by whence.whence
- One of theFileSeekOrigin
seek starting points.
public void setACL(java.lang.String acl, java.lang.Long mode)
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_NOTIMPL | The method is not implemented yet. |
public void setSize(java.lang.Long size)
size
- The new file size.public java.lang.Long write(byte[] data, java.lang.Long timeoutMS)
getOffset()
) is updated on success.
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.
public java.lang.Long writeAt(java.lang.Long offset, byte[] data, java.lang.Long timeoutMS)
getOffset()
) is updated on success.
offset
- Offset in bytes to start writing. If the file was opened with thegetAccessMode()
set toFileAccessMode.AppendOnly
orFileAccessMode.AppendRead
, the offset is ignored and the
write always goes to the end of the file.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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |