Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   
   /*
    *  Copyright (C) 2010-2011 Oracle Corporation
    *
    *  This file is part of the VirtualBox SDK, as available from
    *  http://www.virtualbox.org.  This library is free software; you can
    *  redistribute it and/or modify it under the terms of the GNU Lesser General
    *  Public License as published by the Free Software Foundation, in version 2.1
    *  as it comes in the "COPYING.LIB" file of the VirtualBox SDK distribution.
   *  This library is distributed in the hope that it will be useful, but WITHOUT
   *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
   *  License for more details.
   *
   * IGuestSession.java
   *
   * DO NOT EDIT! This is a generated file.
   * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
   * Generator: src/VBox/Main/glue/glue-java.xsl
   */
  
  package org.virtualbox_4_2;
  
  import javax.xml.ws.*;
  import java.util.List;

A guest session represents one impersonated user account on the guest, so every operation will use the same credentials specified when creating the session object via IGuest.createSession(java.lang.String,java.lang.String,java.lang.String,java.lang.String). There can be a maximum of 32 sessions at once per VM. Each session keeps track of its started guest processes, opened guest files or guest directories. To work on guest files or directories a guest session offers methods to open or create such objects (see fileOpen(java.lang.String,java.lang.String,java.lang.String,java.lang.Long,java.lang.Long) or directoryOpen(java.lang.String,java.lang.String,java.util.List) for example). When done with either of these objects, including the guest session itself, use the appropriate close() method to let the object do its cleanup work. Every guest session has its own environment variable block which gets automatically applied when starting a new guest process via processCreate(java.lang.String,java.util.List,java.util.List,java.util.List,java.lang.Long) or processCreateEx(java.lang.String,java.util.List,java.util.List,java.util.List,java.lang.Long,org.virtualbox_4_2.ProcessPriority,java.util.List). To override (or unset) certain environment variables already set by the guest session, one can specify a per-process environment block when using one of the both above mentioned process creation calls. Interface ID: {57EB82A8-822B-42C1-9D1C-5C54BC3D3250}
  
  public class IGuestSession extends IUnknown {
  
      public IGuestSession(String wrappedVboxPortType port) {
            super(wrappedport);
      }
Returns the user name used by this session to impersonate users on the guest.

Returns:
String
  
      public String getUser() {
        try {
           String retVal = .iGuestSessionGetUser();
           return retVal;
       } catch (InvalidObjectFaultMsg e) {
            throw new VBoxException(ee.getMessage());
       } catch (RuntimeFaultMsg e) {
            throw new VBoxException(ee.getMessage());
       }
      }
Returns the domain name used by this session to impersonate users on the guest.

Returns:
String
  
      public String getDomain() {
        try {
           String retVal = .iGuestSessionGetDomain();
           return retVal;
       } catch (InvalidObjectFaultMsg e) {
            throw new VBoxException(ee.getMessage());
       } catch (RuntimeFaultMsg e) {
            throw new VBoxException(ee.getMessage());
       }
      }
Returns the session's friendly name.

Returns:
String
  
      public String getName() {
        try {
           String retVal = .iGuestSessionGetName();
           return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns the internal session ID.

Returns:
Long
 
     public Long getId() {
       try {
          Long retVal = .iGuestSessionGetId();
          return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns the session timeout (in ms). Expected result codes:
E_NOTIMPL The method is not implemented yet.

Returns:
Long
 
     public Long getTimeout() {
       try {
          Long retVal = .iGuestSessionGetTimeout();
          return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns the session timeout (in ms). Expected result codes:
E_NOTIMPL The method is not implemented yet.

Parameters:
value Long
 
     public void setTimeout(Long value) {
       try {
         .iGuestSessionSetTimeout(value);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns the current session environment.

Returns:
List<String>
 
     public List<StringgetEnvironment() {
       try {
          List<StringretVal = .iGuestSessionGetEnvironment();
          return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns the current session environment.

Parameters:
value List<String>
 
     public void setEnvironment(List<Stringvalue) {
       try {
         .iGuestSessionSetEnvironment(value);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns all current guest processes.

Returns:
List<org.virtualbox_4_2.IGuestProcess>
 
       try {
          List<StringretVal = .iGuestSessionGetProcesses();
          return Helper.wrap(org.virtualbox_4_2.IGuestProcess.classretVal);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns all currently opened guest directories.

Returns:
List<org.virtualbox_4_2.IGuestDirectory>
 
       try {
          List<StringretVal = .iGuestSessionGetDirectories();
          return Helper.wrap(org.virtualbox_4_2.IGuestDirectory.classretVal);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Returns all currently opened guest files.

Returns:
List<org.virtualbox_4_2.IGuestFile>
 
     public List<org.virtualbox_4_2.IGuestFilegetFiles() {
       try {
          List<StringretVal = .iGuestSessionGetFiles();
          return Helper.wrap(org.virtualbox_4_2.IGuestFile.classretVal);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
     public static IGuestSession queryInterface(IUnknown obj) {
        return obj == null ?  null : new IGuestSession(obj.getWrapped(), obj.getRemoteWSPort());
     }
Closes this session. All opened guest directories, files and processes which are not referenced by clients anymore will be uninitialized.
 
     public void close() {
       try {
         .iGuestSessionClose();
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Copies a file from guest to the host.

Parameters:
source Source file on the guest to copy to the host.
dest Destination file name on the host.
flags Copy flags; see CopyFileFlag for more information.
Returns:
Progress object to track the operation completion. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error starting the copy operation.
 
     public org.virtualbox_4_2.IProgress copyFrom(String sourceString destList<org.virtualbox_4_2.CopyFileFlagflags) {
       try {
         String     retVal;
         retVal = .iGuestSessionCopyFrom(sourcedest, Helper.convertEnums(org.virtualbox_4_2.CopyFileFlag.class,org.virtualbox_4_2.jaxws.CopyFileFlag.class,flags));
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IProgress(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Copies a file from host to the guest.

Parameters:
source Source file on the host to copy to the guest.
dest Destination file name on the guest.
flags Copy flags; see CopyFileFlag for more information.
Returns:
Progress object to track the operation completion. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error starting the copy operation.
 
     public org.virtualbox_4_2.IProgress copyTo(String sourceString destList<org.virtualbox_4_2.CopyFileFlagflags) {
       try {
         String     retVal;
         retVal = .iGuestSessionCopyTo(sourcedest, Helper.convertEnums(org.virtualbox_4_2.CopyFileFlag.class,org.virtualbox_4_2.jaxws.CopyFileFlag.class,flags));
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IProgress(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Create a directory on the guest.

Parameters:
path Full path of directory to create.
mode File creation mode.
flags Creation flags; see DirectoryCreateFlag for more information. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while creating the directory.
 
     public void directoryCreate(String pathLong modeList<org.virtualbox_4_2.DirectoryCreateFlagflags) {
       try {
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Create a temporary directory on the guest.

Parameters:
templateName Template for the name of the directory to create. This must contain at least one 'X' character. The first group of consecutive 'X' characters in the template will be replaced by a random alphanumeric string to produce a unique name.
mode The mode of the directory to create. Use 0700 unless there are reasons not to. This parameter is ignored if "secure" is specified.
path The absolute path to create the temporary directory in.
secure Whether to fail if the directory can not be securely created. Currently this means that another unprivileged user cannot manipulate the path specified or remove the temporary directory after it has been created. Also causes the mode specified to be ignored. May not be supported on all guest types.
Returns:
On success this will contain the name of the directory created with full path. Expected result codes:
@link ::VBOX_E_NOT_SUPPORTED VBOX_E_NOT_SUPPORTED The operation is not possible as requested on this particular guest type.
E_INVALIDARG Invalid argument. This includes an incorrectly formatted template, or a non-absolute path.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR The temporary directory could not be created. Possible reasons include a non-existing path or an insecure path when the secure option was requested.
 
     public String directoryCreateTemp(String templateNameLong modeString pathBoolean secure) {
       try {
         String     retVal;
         retVal = .iGuestSessionDirectoryCreateTemp(templateNamemodepathsecure);
         return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Checks whether a directory exists on the guest or not.

Parameters:
path Directory to check existence for.
Returns:
Returns true if the directory exists, false if not. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while checking existence of the directory specified.
 
     public Boolean directoryExists(String path) {
       try {
         Boolean     retVal;
         retVal = .iGuestSessionDirectoryExists(path);
         return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Opens a directory and creates a IGuestDirectory object that can be used for further operations.

Parameters:
path Full path to file to open.
filter Open filter to apply. This can include wildcards like ? and *.
flags Open flags; see DirectoryOpenFlag for more information.
Returns:
IGuestDirectory object containing the opened directory. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND Directory to open was not found.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while opening the directory.
 
       try {
         String     retVal;
         retVal = .iGuestSessionDirectoryOpen(pathfilter, Helper.convertEnums(org.virtualbox_4_2.DirectoryOpenFlag.class,org.virtualbox_4_2.jaxws.DirectoryOpenFlag.class,flags));
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestDirectory(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Queries information of a directory on the guest.

Parameters:
path Directory to query information for.
Returns:
IGuestFsObjInfo object containing the queried information. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND Directory to query information for was not found.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error querying information.
 
       try {
         String     retVal;
         retVal = .iGuestSessionDirectoryQueryInfo(path);
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestFsObjInfo(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Removes a guest directory if not empty.

Parameters:
path Full path of directory to remove. Expected result codes:
E_NOTIMPL The method is not implemented yet.
 
     public void directoryRemove(String path) {
       try {
         .iGuestSessionDirectoryRemove(path);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Removes a guest directory recursively.

Parameters:
path Full path of directory to remove recursively.
flags Remove flags; see DirectoryRemoveRecFlag for more information.
Returns:
Progress object to track the operation completion. Expected result codes:
E_NOTIMPL The method is not implemented yet.
 
       try {
         String     retVal;
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IProgress(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Renames a directory on the guest.

Parameters:
source Source directory to rename.
dest Destination directory to rename the source to.
flags Rename flags; see PathRenameFlag for more information. Expected result codes:
E_NOTIMPL The method is not implemented yet.
 
     public void directoryRename(String sourceString destList<org.virtualbox_4_2.PathRenameFlagflags) {
       try {
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Sets the ACL (Access Control List) of a guest directory.

Parameters:
path Full path of directory to set the ACL for.
acl Actual ACL string to set. Must comply with the guest OS. Expected result codes:
E_NOTIMPL The method is not implemented yet.
 
     public void directorySetACL(String pathString acl) {
       try {
         .iGuestSessionDirectorySetACL(pathacl);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Clears (deletes) all session environment variables. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while clearing the session environment variables.
 
     public void environmentClear() {
       try {
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Gets the value of a session environment variable.

Parameters:
name Name of session environment variable to get the value for.
Returns:
Value of the session environment variable specified. If this variable does not exist and empty value will be returned. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while getting the value of the session environment variable.
 
     public String environmentGet(String name) {
       try {
         String     retVal;
         retVal = .iGuestSessionEnvironmentGet(name);
         return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Sets a session environment variable.

Parameters:
name Name of session environment variable to set.
value Value to set the session environment variable to. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while setting the session environment variable.
 
     public void environmentSet(String nameString value) {
       try {
         .iGuestSessionEnvironmentSet(namevalue);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Unsets session environment variable.

Parameters:
name Name of session environment variable to unset (clear). Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while unsetting the session environment variable.
 
     public void environmentUnset(String name) {
       try {
         .iGuestSessionEnvironmentUnset(name);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Creates a temporary file on the guest.

Parameters:
templateName Template for the name of the file to create. This must contain at least one 'X' character. The first group of consecutive 'X' characters in the template will be replaced by a random alphanumeric string to produce a unique name.
mode The mode of the file to create. Use 0700 unless there are reasons not to. This parameter is ignored if "secure" is specified.
path The absolute path to create the temporary file in.
secure Whether to fail if the file can not be securely created. Currently this means that another unprivileged user cannot manipulate the path specified or remove the temporary file after it has been created. Also causes the mode specified to be ignored. May not be supported on all guest types.
Returns:
On success this will contain an open file object for the new temporary file. Expected result codes:
@link ::VBOX_E_NOT_SUPPORTED VBOX_E_NOT_SUPPORTED The operation is not possible as requested on this particular guest type.
E_INVALIDARG Invalid argument. This includes an incorrectly formatted template, or a non-absolute path.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR The temporary file could not be created. Possible reasons include a non-existing path or an insecure path when the secure option was requested.
 
     public org.virtualbox_4_2.IGuestFile fileCreateTemp(String templateNameLong modeString pathBoolean secure) {
       try {
         String     retVal;
         retVal = .iGuestSessionFileCreateTemp(templateNamemodepathsecure);
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestFile(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Checks whether a file exists on the guest or not.

Parameters:
path File to check existence for.
Returns:
Returns true if the file exists, false if not. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while checking existence of the file specified.
 
     public Boolean fileExists(String path) {
       try {
         Boolean     retVal;
         retVal = .iGuestSessionFileExists(path);
         return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Removes a single file on the guest.

Parameters:
path Path to the file to remove. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND File to remove was not found.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while removing the file.
 
     public void fileRemove(String path) {
       try {
         .iGuestSessionFileRemove(path);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Opens a file and creates a IGuestFile object that can be used for further operations.

Parameters:
path Full path to file to open.
openMode The file open mode.
disposition The file disposition.
creationMode The file creation mode.
offset The initial read/write offset.
Returns:
IGuestFile object representing the opened file. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND File to open was not found.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error while opening the file.
 
     public org.virtualbox_4_2.IGuestFile fileOpen(String pathString openModeString dispositionLong creationModeLong offset) {
       try {
         String     retVal;
         retVal = .iGuestSessionFileOpen(pathopenModedispositioncreationModeoffset);
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestFile(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Queries information of a file on the guest.

Parameters:
path File to query information for.
Returns:
IGuestFsObjInfo object containing the queried information. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND File to query information for was not found.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error querying information.
 
       try {
         String     retVal;
         retVal = .iGuestSessionFileQueryInfo(path);
         return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestFsObjInfo(retVal) : null;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Queries the size of a file on the guest.

Parameters:
path File to query the size for.
Returns:
Queried file size. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND File to rename was not found.
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Error querying file size.
 
     public Long fileQuerySize(String path) {
       try {
         Long     retVal;
         retVal = .iGuestSessionFileQuerySize(path);
         return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Renames a file on the guest.

Parameters:
source Source file to rename.
dest Destination file to rename the source to.
flags Rename flags; see PathRenameFlag for more information. Expected result codes:
E_NOTIMPL The method is not implemented yet.
 
     public void fileRename(String sourceString destList<org.virtualbox_4_2.PathRenameFlagflags) {
       try {
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Sets the ACL (Access Control List) of a file on the guest.

Parameters:
file Full path of file to set the ACL for.
acl Actual ACL string to set. Must comply with the guest OS. Expected result codes:
E_NOTIMPL The method is not implemented yet.
 
     public void fileSetACL(String fileString acl) {
       try {
         .iGuestSessionFileSetACL(fileacl);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Executes an existing program inside the guest VM.

Parameters:
command Full path name of the command to execute on the guest; the commands has to exists in the guest VM in order to be executed.
arguments Array of arguments passed to the execution command.
environment Environment variables that can be set while the command is being executed, in form of "NAME=VALUE"; one pair per entry. To unset a variable just set its name ("NAME") without a value. This parameter can be used to override environment variables set by the guest session, which will be applied to the newly started process in any case.
flags Process creation flags; see ProcessCreateFlag for more information.
timeoutMS Timeout (in ms) to wait for the operation to complete. Pass 0 for an infinite timeout.
Returns:
Guest process object of the newly created process. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Could not create process.
NOTE: Starting at VirtualBox 4.2 guest process execution by default is limited to serve up to 255 guest processes at a time. If all 255 guest processes are still active and running, starting a new guest process will result in an appropriate error message. If ProcessCreateFlag_WaitForStdOut and / or respectively ProcessCreateFlag_WaitForStdErr is / are set, the guest process will not exit until all data from the specified stream(s) is / are read out. To raise or lower the guest process execution limit, either the guest property "/VirtualBox/GuestAdd/VBoxService/--control-procs-max-kept" or VBoxService' command line by specifying "--control-procs-max-kept" needs to be modified. A restart of the guest OS is required afterwards. To serve unlimited guest processes, a value of "0" needs to be set (not recommended).
    public org.virtualbox_4_2.IGuestProcess processCreate(String commandList<StringargumentsList<StringenvironmentList<org.virtualbox_4_2.ProcessCreateFlagflagsLong timeoutMS) {
      try {
        String     retVal;
        retVal = .iGuestSessionProcessCreate(commandargumentsenvironment, Helper.convertEnums(org.virtualbox_4_2.ProcessCreateFlag.class,org.virtualbox_4_2.jaxws.ProcessCreateFlag.class,flags), timeoutMS);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestProcess(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Executes an existing program inside the guest VM. Extended version for also setting the process priority and affinity.

Parameters:
command Full path name of the command to execute on the guest; the commands has to exists in the guest VM in order to be executed.
arguments Array of arguments passed to the execution command.
environment Environment variables that can be set while the command is being executed, in form of "NAME=VALUE"; one pair per entry. To unset a variable just set its name ("NAME") without a value. This parameter can be used to override environment variables set by the guest session, which will be applied to the newly started process in any case.
flags Process creation flags; see ProcessCreateFlag for more information.
timeoutMS Timeout (in ms) to wait for the operation to complete. Pass 0 for an infinite timeout.
priority Process priority to use for execution; see see ProcessPriority for more information.
affinity Process affinity to use for execution. This parameter is not implemented yet.
Returns:
Guest process object of the newly created process. Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR Could not create process.
NOTE: Starting at VirtualBox 4.2 guest process execution by default is limited to serve up to 255 guest processes at a time. If all 255 guest processes are still active and running, starting a new guest process will result in an appropriate error message. If ProcessCreateFlag_WaitForStdOut and / or respectively ProcessCreateFlag_WaitForStdErr is / are set, the guest process will not exit until all data from the specified stream(s) is / are read out. To raise or lower the guest process execution limit, either the guest property "/VirtualBox/GuestAdd/VBoxService/--control-procs-max-kept" or VBoxService' command line by specifying "--control-procs-max-kept" needs to be modified. A restart of the guest OS is required afterwards. To serve unlimited guest processes, a value of "0" needs to be set (not recommended).
    public org.virtualbox_4_2.IGuestProcess processCreateEx(String commandList<StringargumentsList<StringenvironmentList<org.virtualbox_4_2.ProcessCreateFlagflagsLong timeoutMSorg.virtualbox_4_2.ProcessPriority priorityList<Integeraffinity) {
      try {
        String     retVal;
        retVal = .iGuestSessionProcessCreateEx(commandargumentsenvironment, Helper.convertEnums(org.virtualbox_4_2.ProcessCreateFlag.class,org.virtualbox_4_2.jaxws.ProcessCreateFlag.class,flags), timeoutMS, org.virtualbox_4_2.jaxws.ProcessPriority.fromValue(priority.name()), affinity);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestProcess(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Gets a certain guest process by its process ID (PID).

Parameters:
pid Process ID (PID) to get guest process for.
Returns:
Guest process of specified process ID (PID).
      try {
        String     retVal;
        retVal = .iGuestSessionProcessGet(pid);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IGuestProcess(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Creates a symbolic link on the guest.

Parameters:
source The name of the symbolic link.
target The path to the symbolic link target.
type The symbolic link type; see SymlinkReadFlag for more information. Expected result codes:
E_NOTIMPL The method is not implemented yet.
    public void symlinkCreate(String sourceString targetorg.virtualbox_4_2.SymlinkType type) {
      try {
        .iGuestSessionSymlinkCreate(sourcetarget, org.virtualbox_4_2.jaxws.SymlinkType.fromValue(type.name()));
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Checks whether a symbolic link exists on the guest or not.

Parameters:
symlink Symbolic link to check existence for.
Returns:
Returns true if the symbolic link exists, false if not. Expected result codes:
E_NOTIMPL The method is not implemented yet.
    public Boolean symlinkExists(String symlink) {
      try {
        Boolean     retVal;
        retVal = .iGuestSessionSymlinkExists(symlink);
        return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Reads a symbolic link on the guest.

Parameters:
symlink Full path to symbolic link to read.
flags Read flags; see SymlinkReadFlag for more information.
Returns:
Target of the symbolic link pointing to, if found. Expected result codes:
E_NOTIMPL The method is not implemented yet.
    public String symlinkRead(String symlinkList<org.virtualbox_4_2.SymlinkReadFlagflags) {
      try {
        String     retVal;
        return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Removes a symbolic link on the guest if it's a directory.

Parameters:
path Symbolic link to remove. Expected result codes:
E_NOTIMPL The method is not implemented yet.
    public void symlinkRemoveDirectory(String path) {
      try {
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Removes a symbolic link on the guest if it's a file.

Parameters:
file Symbolic link to remove. Expected result codes:
E_NOTIMPL The method is not implemented yet.
    public void symlinkRemoveFile(String file) {
      try {
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
New to GrepCode? Check out our FAQ X