org.glassfish.virtualization.spi
Interface Disk


@Contract
public interface Disk

Interface to create and manipulate a virtual disk

Author:
Jerome Dochez

Method Summary
 int create(File path, int size, File mountPoint)
          Creates a virtual disk
 int createISOFromDirectory(File sourceDirectory, File outputISOFile)
          create an ISO File with the content of a directory
 int mount(File path, File mountPoint)
          Mount an existing virtual disk
 int umount()
          Un-mount this virtual disk instance
 

Method Detail

create

int create(File path,
           int size,
           File mountPoint)
           throws IOException
Creates a virtual disk

Parameters:
path - path to the virtual disk file
size - size of the virtual disk
mountPoint - directory where the virtual disk should be mounted
Returns:
0 if success, not 0 if failure (passed by the underlying native mechanism
Throws:
IOException - when the disk cannot be created.

mount

int mount(File path,
          File mountPoint)
          throws IOException
Mount an existing virtual disk

Parameters:
path - path to the virtual disk file
mountPoint - directory to use to mount the virtual disk
Returns:
0 if success, not 0 if failure as returned by the native mechanism
Throws:
IOException - if the virtual disk cannot be mounted

umount

int umount()
           throws IOException
Un-mount this virtual disk instance

Throws:
IOException - if the disk cannot be un-mounted

createISOFromDirectory

int createISOFromDirectory(File sourceDirectory,
                           File outputISOFile)
                           throws IOException
create an ISO File with the content of a directory

Parameters:
sourceDirectory - path to the directory content to put in the iso file
outputISOFile - location of the created iso file. (It will be delete first if present)
Returns:
0 if success, not 0 if failure as returned by the native mechanism
Throws:
IOException - if the ISO file cannot be created


Copyright © 2012. All Rights Reserved.