Package org.silverpeas.components.gallery.model

# Class InternalMedia

java.lang.Object
org.silverpeas.components.gallery.model.Media
org.silverpeas.components.gallery.model.InternalMedia

All Implemented Interfaces:
  `Serializable`, `org.silverpeas.core.contribution.model.Contribution`, `org.silverpeas.core.contribution.model.SilverpeasContent`, `org.silverpeas.core.contribution.model.WithPermanentLink`, `org.silverpeas.core.contribution.model.WithURL`, `org.silverpeas.core.Identifiable`, `org.silverpeas.core.Instance<org.silverpeas.core.contribution.model.Contribution>`, `org.silverpeas.core.Nameable`, `org.silverpeas.core.security.Securable`, `org.silverpeas.core.SilverpeasResource`

Direct Known Subclasses:
  `Photo`, `Sound`, `Video`

public abstract class InternalMedia extends Media
This class represents a Media that the content (the file in other words) is saved on the Silverpeas workspace.

See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class org.silverpeas.components.gallery.model.Media

  `BASE_PATH`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `InternalMedia()`
  `protected`
  `InternalMedia(InternalMedia other)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `MetaDataSet`
  `getAllMetaData()`
  `String`
  `getApplicationThumbnailUrl(MediaResolution mediaResolution)`
  Gets the Application URL thumbnail of the media according the specified media resolution.
  `org.silverpeas.core.date.period.Period`
  `getDownloadPeriod()`
  `org.silverpeas.core.io.file.SilverpeasFile`
  `getFile(MediaResolution mediaResolution, String size)`
  Gets the Silverpeas file.
  `MediaMimeType`
  `getFileMimeType()`
  `String`
  `getFileName()`
  `long`
  `getFileSize()`
  `int`
  `hashCode()`
  `boolean`
  `isDownloadable()`
  Indicates if the download is possible according the visibility information.
  `boolean`
  `isDownloadAuthorized()`
  Indicates if the media is marked as downloadable.
  `void`
  `setDownloadAuthorized(boolean downloadAuthorized)`
  `void`
  `setDownloadPeriod(org.silverpeas.core.date.period.Period downloadPeriod)`
  `void`
  `setFileMimeType(MediaMimeType fileMimeType)`
  `void`
  `setFileName(String fileName)`
  `void`
  `setFileSize(long fileSize)`

  ### Methods inherited from class org.silverpeas.components.gallery.model.Media

  `addToAlbums, canBeAccessedBy, getApplicationEmbedUrl, getApplicationOriginalUrl, getAuthor, getComponentInstanceId, getContributionType, getCopy, getCreationDate, getCreator, getCreatorId, getCreatorName, getDescription, getFile, getHighestUserRole, getId, getInstanceId, getInternalMedia, getKeyWord, getLastUpdateDate, getLastUpdatedBy, getLastUpdater, getLastUpdaterName, getMediaPK, getPermalink, getPhoto, getSilverpeasContentId, getSound, getStreaming, getTitle, getType, getURL, getVideo, getVisibilityPeriod, getWorkspaceSubFolderName, isPreviewable, isVisible, isVisible, removeFromAllAlbums, setAuthor, setComponentInstanceId, setCreationDate, setCreator, setCreatorId, setDescription, setId, setKeyWord, setLastUpdateDate, setLastUpdatedBy, setLastUpdater, setMediaPK, setSilverpeasContentId, setTitle, setToAlbums, setVisibilityPeriod, toString`

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

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

  ### Methods inherited from interface org.silverpeas.core.contribution.model.Contribution

  `getModel, getName, getResourcePath, isIndexable`

  ### Methods inherited from interface org.silverpeas.core.Instance

  `getParent`

  ### Methods inherited from interface org.silverpeas.core.security.Securable

  `canBeDeletedBy, canBeFiledInBy, canBeModifiedBy`

  ### Methods inherited from interface org.silverpeas.core.contribution.model.SilverpeasContent

  `getIdentifier`

- ## Constructor Details

  - ### InternalMedia

    protected InternalMedia()

  - ### InternalMedia

    protected InternalMedia(InternalMedia other)

- ## Method Details

  - ### isDownloadAuthorized

    public boolean isDownloadAuthorized()
    Indicates if the media is marked as downloadable. The visibility period is not taken into account here.
    Returns:
      true if marked as downloadable, false otherwise.

  - ### isDownloadable

    public boolean isDownloadable()
    Indicates if the download is possible according the visibility information. The date of day must be included into visibility period.
    Overrides:
      `isDownloadable` in class `Media`
    Returns:
      true if download is possible, false otherwise.

  - ### getFileName

    public String getFileName()

  - ### setFileName

    public void setFileName(String fileName)

  - ### getFileSize

    public long getFileSize()

  - ### setFileSize

    public void setFileSize(long fileSize)

  - ### getFileMimeType

    public MediaMimeType getFileMimeType()

  - ### setFileMimeType

    public void setFileMimeType(MediaMimeType fileMimeType)

  - ### setDownloadAuthorized

    public void setDownloadAuthorized(boolean downloadAuthorized)

  - ### getDownloadPeriod

    public org.silverpeas.core.date.period.Period getDownloadPeriod()

  - ### setDownloadPeriod

    public void setDownloadPeriod(org.silverpeas.core.date.period.Period downloadPeriod)

  - ### getAllMetaData

    public MetaDataSet getAllMetaData()

  - ### getApplicationThumbnailUrl

    public String getApplicationThumbnailUrl(MediaResolution mediaResolution)
    Description copied from class: `Media`
    Gets the Application URL thumbnail of the media according the specified media resolution.
    Overrides:
      `getApplicationThumbnailUrl` in class `Media`
    Parameters:
      `mediaResolution` - resolution of the media
    Returns:
      the URL of media thumbnail.

  - ### getFile

    public org.silverpeas.core.io.file.SilverpeasFile getFile(MediaResolution mediaResolution, String size)
    Description copied from class: `Media`
    Gets the Silverpeas file.
    Specified by:
      `getFile` in class `Media`
    Parameters:
      `mediaResolution` - the aimed resolution.
      `size` - a specific size applied on the aimed resolution, ignored if not defined.
    Returns:
      a `SilverpeasFile` instance which could represents also a non-existing file.

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Media`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Media`