nn.pp.vmcore

## Class RedirectableObject

- java.lang.Object
- - nn.pp.vmcore.RedirectableObject

-     public abstract class RedirectableObject
      extends java.lang.Object

  This represents anything which can be redirected for a Virtual Media session. Currently, these are physical drives, (ISO) image files and local folders.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedirectableObject()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<RedirectableObject>` | `getAvailableDrives(java.util.logging.Logger logger)` Enumerate all the (physical) drives available in the system which can be used for drive redirection.
    `abstract VMCore.DriveType` | `getDriveType(java.util.logging.Logger logger)` Determine the drive type of the redirectable object.
    `static RedirectableObject` | `getImage(java.io.File file, java.util.logging.Logger logger, VMCore.DriveType requiredDriveType)` Create a new `RedirectableObject` for an image file of a specific type.
    `static RedirectableObject` | `getIsoImage(java.io.File file)` Creates a new `RedirectableObject` for an ISO image file.
    `abstract java.lang.String` | `getLongName()` Get a long description of the redirectable object.
    `static RedirectableObject` | `getRedirectedFolder(java.io.File folder)` Creates a new `RedirectableObject` for a local folder.
    `abstract java.lang.String` | `getRedirectionType()` Get the type of the redirectable object (native drive, image file, etc.)
    `abstract java.lang.String` | `getShortName()` Get a short description of the redirectable object.
    `java.lang.String` | `toString()` Get a string representation of the object

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RedirectableObject

          public RedirectableObject()

  - ### Method Detail

    - #### getAvailableDrives

          public static java.util.List<RedirectableObject> getAvailableDrives(java.util.logging.Logger logger)

      Enumerate all the (physical) drives available in the system which can be used for drive redirection.
      Parameters:
        `logger` - the logging object
      Returns:
        The List of all physical drives which can be redirected

    - #### getIsoImage

          public static RedirectableObject getIsoImage(java.io.File file)

      Creates a new `RedirectableObject` for an ISO image file.
      Parameters:
        `file` - the image file to create the `RedirectableObject` for
      Returns:
        the `RedirectableObject` for the image file

    - #### getImage

          public static RedirectableObject getImage(java.io.File file,
                                                    java.util.logging.Logger logger,
                                                    VMCore.DriveType requiredDriveType)
                                             throws java.io.IOException,
                                                    VMException

      Create a new `RedirectableObject` for an image file of a specific type.

      If the image file does not match the specified type, then a `VMException` is thrown.

      Parameters:
        `file` - the image file to create the `RedirectableObject` for
        `logger` - the logging object
        `requiredDriveType` - the requested type of image
      Returns:
        the `RedirectableObject` for the image file
      Throws:
        `java.io.IOException` - if an I/O error occurs (e.g. the file is not readable)
        `VMException` - if a VM related error occurs, e.g. the image file is not valid or does not match the requested image type.

    - #### getRedirectedFolder

          public static RedirectableObject getRedirectedFolder(java.io.File folder)

      Creates a new `RedirectableObject` for a local folder. This is used to redirect the folder as a remote drive.

      CAUTION: This code is in beta stage and should be used with care. Especially, write support is known to be not working well.

      NOTE: This code may taint FAT, FAT32 and VFAT patents. So it is only allowed to use it if you own a license for these technologies.

      Parameters:
        `folder` - the local folder
      Returns:
        the `RedirectableObject` for the folder

    - #### getShortName

          public abstract java.lang.String getShortName()

      Get a short description of the redirectable object.

      For drives under Windows, this is "C:" for the drive C.

      Returns:
        The short name / description
      See Also:
        `getLongName()`

    - #### getLongName

          public abstract java.lang.String getLongName()

      Get a long description of the redirectable object.

      For drives under Windows, this is "C: (Hard Disk Partition)" for the drive C.

      Returns:
        the long name / description
      See Also:
        `getShortName()`

    - #### getRedirectionType

          public abstract java.lang.String getRedirectionType()

      Get the type of the redirectable object (native drive, image file, etc.)
      Returns:
        the type as string

    - #### getDriveType

          public abstract VMCore.DriveType getDriveType(java.util.logging.Logger logger)
                                                 throws java.io.IOException,
                                                        VMException

      Determine the drive type of the redirectable object.

      For an image file, this will parse the file. For a native drive under Windows, this is clear from the beginning.

      Parameters:
        `logger` - a logging object for debugging purposes
      Returns:
        the drive type
      Throws:
        `java.io.IOException` - if an I/O error occurs.
        `VMException` - if an Virtual Media related error occurs

    - #### toString

          public java.lang.String toString()

      Get a string representation of the object
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string representation of the object

Copyright © 2025 Raritan Inc. All Rights Reserved.