com.silverpeas.gallery.model
Class InternalMedia

java.lang.Object
  extended by com.silverpeas.gallery.model.Media
      extended by com.silverpeas.gallery.model.InternalMedia
All Implemented Interfaces:
com.silverpeas.SilverpeasContent, com.stratelia.silverpeas.contentManager.SilverContentInterface, Serializable
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 com.silverpeas.gallery.model.Media
BASE_PATH
 
Constructor Summary
InternalMedia()
           
 
Method Summary
 void addMetaData(MetaData data)
          Adds a metadata.
 String getApplicationThumbnailUrl(MediaResolution mediaResolution)
          Gets the Application URL thumbnail of the media according the specified media resolution.
 org.silverpeas.date.Period getDownloadPeriod()
           
 org.silverpeas.file.SilverpeasFile getFile(MediaResolution mediaResolution)
          Gets the Silverpeas file.
 MediaMimeType getFileMimeType()
           
 String getFileName()
           
 long getFileSize()
           
 MetaData getMetaData(String property)
          Gets a metadata according to the specified property name.
 Collection<String> getMetaDataProperties()
          Gets all metadata property names.
 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.date.Period downloadPeriod)
           
 void setFileMimeType(MediaMimeType fileMimeType)
           
 void setFileName(String fileName)
           
 void setFileSize(long fileSize)
           
 
Methods inherited from class com.silverpeas.gallery.model.Media
addToAlbums, canBeAccessedBy, equals, getApplicationEmbedUrl, getApplicationOriginalUrl, getAuthor, getComponentInstanceId, getContributionType, getCreationDate, getCreator, getCreatorId, getCreatorName, getDate, getDescription, getDescription, getGreatestUserRole, getIconUrl, getId, getInstanceId, getInternalMedia, getKeyWord, getLanguages, getLastUpdateDate, getLastUpdatedBy, getLastUpdater, getLastUpdaterName, getMediaPK, getName, getName, getPermalink, getPhoto, getSilverCreationDate, getSilverpeasContentId, getSound, getStreaming, getTitle, getType, getURL, getVideo, getVisibilityPeriod, getWorkspaceSubFolderName, hashCode, isPreviewable, isVisible, isVisible, removeFromAllAlbums, setAuthor, setComponentInstanceId, setCreationDate, setCreator, setCreatorId, setDescription, setIconUrl, 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
 

Constructor Detail

InternalMedia

public InternalMedia()
Method Detail

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.date.Period getDownloadPeriod()

setDownloadPeriod

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

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
Returns:
the URL of media thumbnail.

getFile

public org.silverpeas.file.SilverpeasFile getFile(MediaResolution mediaResolution)
Description copied from class: Media
Gets the Silverpeas file.

Specified by:
getFile in class Media
Returns:

addMetaData

public void addMetaData(MetaData data)
Adds a metadata.

Parameters:
data - a metadata.

getMetaData

public MetaData getMetaData(String property)
Gets a metadata according to the specified property name.

Parameters:
property - the property name for which the metadata is requested.
Returns:
the metadata if it exists, null otherwise.

getMetaDataProperties

public Collection<String> getMetaDataProperties()
Gets all metadata property names.

Returns:
the list of metadata property names, empty list if no metadata.


Copyright © 2016 Silverpeas. All Rights Reserved.