Package io.github.mastodonContentMover
Class MediaFile
java.lang.Object
io.github.mastodonContentMover.MediaFile
Holds in an XML-persistable object the metadata associated with a media file attached
   to a 
Post object.
   Because this class uses JAXB and instances of it are held within Post
   objects, persistance is managed by the associated Post
   object (instances of this class are saved when the Post
   object that contains them are saved), so no marshalling or unmarshalling code is needed here.- Since:
- 0.01.00
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected StringRetrieves the alt text or description of the content in the media file associated with thisMediaFile, corresponding to thedescriptionfield within Mastodon.protected StringRetrieves the path on the local file system for the media file associated with thisMediaFileobject.protected floatRetrieves x coordinate of the focal point for the media file associated with thisMediaFileobject.protected floatRetrieves y coordinate of the focal point for the media file associated with thisMediaFileobject.protected StringRetrieves the Mastodon media type for the media file associated with thisMediaFile, corresponding to thedescriptionfield within Mastodon.protected StringRetrieves the MIME type of the media file associated with thisMediaFileobject, used when reuploading the file to Mastodon to attach to a reposted status.protected StringRetrieves the path on the local file system for the thumbnail for the media file associated with thisMediaFileobject.protected static StringObtain the suffix that should be attached to the name of a media file (without the file extension) when naming a thumbnail for that media file.protected voidsetAltText(String at) Stores the value of the Mastodondescriptionfield, which is an alt text or description, for the media file associated with thisMediaFileobject.protected voidStores the directory where the media file associated with thisMediaFileobject is stored on the local file system.protected voidsetFocalPoint(float x, float y) Stores the x and y coordinates of the focal point for the media file associated with thisMediaFileobject, which allow Mastodon to preview a limited area of an image according to the user's preferences when not all of it is visible in the user interface.
- 
Constructor Details- 
MediaFile- Parameters:
- fn- the filename for the media file to be associated with this- MediaFileobject
- Since:
- 0.01.00
 
- 
MediaFileCreates aMediaFileobject with the filename, directory, Mastodon media type, thumbnail filename, alt text (description) and focal point coordinates (x and y) specified.
 MIME type is determined based on the extension of the media file, so it can be used when reuploading the file to Mastodon to attach to a reposted status.- Parameters:
- fn- the filename for the media file to be associated with this- MediaFileobject
- d- the directory where the media file is stored within the local file system
- tfn- the filename of a thumbnail for the media file
- mm- the Mastodon media type
- at- the alt text or description of the content in this media file
- x- the x coordinate for the focal point for this media file
- y- the y coordinate for the focal point for this media file
- Since:
- 0.01.00
- See Also:
 
 
- 
- 
Method Details- 
setDirectoryStores the directory where the media file associated with thisMediaFileobject is stored on the local file system.- Parameters:
- d- the directory where the media file is stored
- Since:
- 0.01.00
 
- 
getFilepathRetrieves the path on the local file system for the media file associated with thisMediaFileobject.- Returns:
- the path on the local file system for the media file
   
- Since:
- 0.01.00
 
- 
getThumbnailFilepathRetrieves the path on the local file system for the thumbnail for the media file associated with thisMediaFileobject.- Returns:
- the path on the local file system for the thumbnail file
   
- Since:
- 0.01.00
 
- 
getThumbnailFileSuffixObtain the suffix that should be attached to the name of a media file (without the file extension) when naming a thumbnail for that media file.- Returns:
- the suffix
   
- Since:
- 0.01.00
 
- 
getMimeTypeRetrieves the MIME type of the media file associated with thisMediaFileobject, used when reuploading the file to Mastodon to attach to a reposted status.- Returns:
- the MIME type of the media file
   
- Since:
- 0.01.00
 
- 
getMastodonMediaTypeRetrieves the Mastodon media type for the media file associated with thisMediaFile, corresponding to thedescriptionfield within Mastodon. object.- Returns:
- the Mastodon media type for the media file 
   
- Since:
- 0.01.00
- See Also:
 
- 
setAltTextStores the value of the Mastodondescriptionfield, which is an alt text or description, for the media file associated with thisMediaFileobject.- Parameters:
- at- the alt text or description of the content in the media file
- Since:
- 0.01.00
- See Also:
 
- 
getAltTextRetrieves the alt text or description of the content in the media file associated with thisMediaFile, corresponding to thedescriptionfield within Mastodon. object.- Returns:
- the alt text or description of the content in the media file
   
- Since:
- 0.01.00
- See Also:
 
- 
setFocalPointprotected void setFocalPoint(float x, float y) Stores the x and y coordinates of the focal point for the media file associated with thisMediaFileobject, which allow Mastodon to preview a limited area of an image according to the user's preferences when not all of it is visible in the user interface.- Parameters:
- x- the x coordinate for the focal point for this media file
- y- the y coordinate for the focal point for this media file
- Since:
- 0.01.00
- See Also:
 
- 
getFocalPointXprotected float getFocalPointX()- Returns:
- the x coordinate for the focal point for this media file
   
- Since:
- 0.01.00
- See Also:
 
- 
getFocalPointYprotected float getFocalPointY()- Returns:
- the y coordinate for the focal point for this media file
   
- Since:
- 0.01.00
- See Also:
 
 
-