Class LibraryImage

java.lang.Object
org.netxms.client.LibraryImage
All Implemented Interfaces:
Comparable<LibraryImage>

public class LibraryImage extends Object implements Comparable<LibraryImage>
This class represents image in image library
  • Constructor Details

    • LibraryImage

      public LibraryImage()
      Default constructor
    • LibraryImage

      public LibraryImage(UUID guid, String name, String category, String mimeType)
      Create new library image
      Parameters:
      guid - GUID
      name - name
      category - image category name
      mimeType - image MIME type
    • LibraryImage

      public LibraryImage(NXCPMessage msg, long baseId)
      Create library image object from NXCP message
      Parameters:
      msg - NXCP message
      baseId - base field ID
    • LibraryImage

      public LibraryImage(NXCPMessage msg, File imageFile)
      Create library image object from NXCP message and image file
      Parameters:
      msg - Message containing object's data
      imageFile - image file
  • Method Details

    • fillMessage

      public void fillMessage(NXCPMessage msg)
      Fill NXCP message with image data (metadata only)
      Parameters:
      msg - NXCP message
    • getGuid

      public UUID getGuid()
      Returns:
      the guid
    • setGuid

      public void setGuid(UUID guid)
      Parameters:
      guid - the guid to set
    • getName

      public String getName()
      Returns:
      the name
    • setName

      public void setName(String name)
      Parameters:
      name - the name to set
    • getCategory

      public String getCategory()
      Returns:
      the category
    • setCategory

      public void setCategory(String category)
      Parameters:
      category - the category to set
    • getBinaryData

      public byte[] getBinaryData()
      Returns:
      the binaryData
    • setBinaryData

      public void setBinaryData(byte[] binaryData, String mimeType)
      Set image binary data.
      Parameters:
      binaryData - image binary data
      mimeType - image MIME type (will be set to "image/unknown" if mimeType is null)
    • isProtected

      public boolean isProtected()
      Returns:
      is image protected?
    • isComplete

      public boolean isComplete()
      Returns:
      is complete (contains binary data)?
    • getMimeType

      public String getMimeType()
      Get image MIME type.
      Returns:
      image MIME type
    • setMimeType

      public void setMimeType(String mimeType)
      Parameters:
      mimeType - the mimeType to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(LibraryImage o)
      Specified by:
      compareTo in interface Comparable<LibraryImage>