Package com.biglybt.core.devices.impl
Class TranscodeFileImpl
- java.lang.Object
-
- com.biglybt.core.devices.impl.TranscodeFileImpl
-
- All Implemented Interfaces:
TranscodeFile
class TranscodeFileImpl extends java.lang.Object implements TranscodeFile
-
-
Field Summary
Fields Modifier and Type Field Description private DeviceImpl
device
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,?>>
files_map
private java.lang.String
key
private static java.lang.String
KEY_CATEGORIES
private static java.lang.String
KEY_COPY_TO_OVERRIDE
private static java.lang.String
KEY_COPYING
private static java.lang.String
KEY_DATE
private static java.lang.String
KEY_DURATION
protected static java.lang.String
KEY_FILE
private static java.lang.String
KEY_FOR_JOB
private static java.lang.String
KEY_NO_XCODE
private static java.lang.String
KEY_PROFILE_NAME
private static java.lang.String
KEY_SOURCE_FILE_HASH
private static java.lang.String
KEY_SOURCE_FILE_INDEX
private static java.lang.String
KEY_SOURCE_FILE_LINK
private static java.lang.String
KEY_TAGS
private static java.lang.String
KEY_VIDEO_HEIGHT
private static java.lang.String
KEY_VIDEO_WIDTH
private static java.lang.String
KEY_XCODE_SIZE
private static TagManager
tag_manager
-
Fields inherited from interface com.biglybt.core.devices.TranscodeFile
PT_CATEGORY, PT_COMPLETE, PT_COPIED, PT_COPY_FAILED, PT_TAGS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TranscodeFileImpl(DeviceImpl _device, java.lang.String _key, java.lang.String _profile_name, java.util.Map<java.lang.String,java.util.Map<java.lang.String,?>> _files_map, java.io.File _file, boolean _for_job)
protected
TranscodeFileImpl(DeviceImpl _device, java.lang.String _key, java.util.Map<java.lang.String,java.util.Map<java.lang.String,?>> _map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkDeleted()
void
delete(boolean delete_contents)
protected void
deleteCacheFile()
boolean
equals(java.lang.Object other)
protected boolean
getBoolean(java.lang.String key)
java.io.File
getCacheFile()
java.io.File
getCacheFileIfExists()
java.lang.String[]
getCategories()
long
getCopyToDeviceFails()
java.lang.String
getCopyToFolderOverride()
long
getCreationDateMillis()
Device
getDevice()
long
getDurationMillis()
long
getEstimatedTranscodeSize()
TranscodeJobImpl
getJob()
Will return null unless there is a job in existance for this fileprotected java.lang.String
getKey()
protected long
getLong(java.lang.String key)
private java.util.Map<java.lang.String,?>
getMap()
private java.util.Map<java.lang.String,?>
getMap(boolean create)
java.lang.String
getMimeType()
java.lang.String
getName()
java.lang.String
getProfileName()
DiskManagerFileInfo
getSourceFile()
java.net.URL
getStreamURL()
java.net.URL
getStreamURL(java.lang.String host)
protected java.lang.String
getString()
protected java.lang.String
getString(java.lang.String key)
java.lang.String[]
getTags(boolean localize)
DiskManagerFileInfo
getTargetFile()
boolean
getTranscodeRequired()
java.lang.Object
getTransientProperty(java.lang.Object key2)
long
getVideoHeight()
long
getVideoWidth()
int
hashCode()
boolean
isComplete()
boolean
isCopiedToDevice()
boolean
isCopyingToDevice()
boolean
isDeleted()
boolean
isTemplate()
void
retryCopyToDevice()
protected void
setBoolean(java.lang.String key, boolean b)
protected void
setCacheFile(java.io.File file)
void
setCategories(java.lang.String[] cats)
protected void
setComplete(boolean b)
protected void
setCopiedToDevice(boolean b)
void
setCopyingToDevice(boolean b)
protected void
setCopyToDeviceFailed()
protected void
setCopyToFolderOverride(java.lang.String s)
protected void
setLong(java.lang.String key, long value)
protected void
setProfileName(java.lang.String s)
protected void
setResolution(int video_width, int video_height)
protected void
setSourceFile(DiskManagerFileInfo file)
protected void
setString(java.lang.String key, java.lang.String value)
void
setTags(java.lang.String[] tags)
protected void
setTranscodeRequired(boolean required)
void
setTransientProperty(java.lang.Object key2, java.lang.Object value)
protected void
update(TranscodeProviderAnalysis analysis)
-
-
-
Field Detail
-
KEY_FILE
protected static final java.lang.String KEY_FILE
- See Also:
- Constant Field Values
-
tag_manager
private static final TagManager tag_manager
-
KEY_PROFILE_NAME
private static final java.lang.String KEY_PROFILE_NAME
- See Also:
- Constant Field Values
-
KEY_SOURCE_FILE_HASH
private static final java.lang.String KEY_SOURCE_FILE_HASH
- See Also:
- Constant Field Values
-
KEY_SOURCE_FILE_INDEX
private static final java.lang.String KEY_SOURCE_FILE_INDEX
- See Also:
- Constant Field Values
-
KEY_SOURCE_FILE_LINK
private static final java.lang.String KEY_SOURCE_FILE_LINK
- See Also:
- Constant Field Values
-
KEY_NO_XCODE
private static final java.lang.String KEY_NO_XCODE
- See Also:
- Constant Field Values
-
KEY_FOR_JOB
private static final java.lang.String KEY_FOR_JOB
- See Also:
- Constant Field Values
-
KEY_DURATION
private static final java.lang.String KEY_DURATION
- See Also:
- Constant Field Values
-
KEY_VIDEO_WIDTH
private static final java.lang.String KEY_VIDEO_WIDTH
- See Also:
- Constant Field Values
-
KEY_VIDEO_HEIGHT
private static final java.lang.String KEY_VIDEO_HEIGHT
- See Also:
- Constant Field Values
-
KEY_XCODE_SIZE
private static final java.lang.String KEY_XCODE_SIZE
- See Also:
- Constant Field Values
-
KEY_DATE
private static final java.lang.String KEY_DATE
- See Also:
- Constant Field Values
-
KEY_CATEGORIES
private static final java.lang.String KEY_CATEGORIES
- See Also:
- Constant Field Values
-
KEY_TAGS
private static final java.lang.String KEY_TAGS
- See Also:
- Constant Field Values
-
KEY_COPY_TO_OVERRIDE
private static final java.lang.String KEY_COPY_TO_OVERRIDE
- See Also:
- Constant Field Values
-
KEY_COPYING
private static final java.lang.String KEY_COPYING
- See Also:
- Constant Field Values
-
device
private DeviceImpl device
-
key
private java.lang.String key
-
files_map
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,?>> files_map
-
-
Constructor Detail
-
TranscodeFileImpl
protected TranscodeFileImpl(DeviceImpl _device, java.lang.String _key, java.lang.String _profile_name, java.util.Map<java.lang.String,java.util.Map<java.lang.String,?>> _files_map, java.io.File _file, boolean _for_job)
-
TranscodeFileImpl
protected TranscodeFileImpl(DeviceImpl _device, java.lang.String _key, java.util.Map<java.lang.String,java.util.Map<java.lang.String,?>> _map) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getKey
protected java.lang.String getKey()
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceTranscodeFile
-
getDevice
public Device getDevice()
- Specified by:
getDevice
in interfaceTranscodeFile
-
getJob
public TranscodeJobImpl getJob()
Description copied from interface:TranscodeFile
Will return null unless there is a job in existance for this file- Specified by:
getJob
in interfaceTranscodeFile
- Returns:
-
getCacheFile
public java.io.File getCacheFile() throws TranscodeException
- Throws:
TranscodeException
-
setCacheFile
protected void setCacheFile(java.io.File file)
-
checkDeleted
protected void checkDeleted() throws TranscodeException
- Throws:
TranscodeException
-
getSourceFile
public DiskManagerFileInfo getSourceFile() throws TranscodeException
- Specified by:
getSourceFile
in interfaceTranscodeFile
- Throws:
TranscodeException
-
setSourceFile
protected void setSourceFile(DiskManagerFileInfo file)
-
getTargetFile
public DiskManagerFileInfo getTargetFile() throws TranscodeException
- Specified by:
getTargetFile
in interfaceTranscodeFile
- Throws:
TranscodeException
-
setTranscodeRequired
protected void setTranscodeRequired(boolean required) throws TranscodeException
- Throws:
TranscodeException
-
getTranscodeRequired
public boolean getTranscodeRequired()
- Specified by:
getTranscodeRequired
in interfaceTranscodeFile
-
setComplete
protected void setComplete(boolean b)
-
isComplete
public boolean isComplete()
- Specified by:
isComplete
in interfaceTranscodeFile
-
isTemplate
public boolean isTemplate()
- Specified by:
isTemplate
in interfaceTranscodeFile
-
setCopiedToDevice
protected void setCopiedToDevice(boolean b)
-
setCopyToDeviceFailed
protected void setCopyToDeviceFailed()
-
getCopyToDeviceFails
public long getCopyToDeviceFails()
- Specified by:
getCopyToDeviceFails
in interfaceTranscodeFile
-
isCopiedToDevice
public boolean isCopiedToDevice()
- Specified by:
isCopiedToDevice
in interfaceTranscodeFile
-
retryCopyToDevice
public void retryCopyToDevice()
- Specified by:
retryCopyToDevice
in interfaceTranscodeFile
-
setProfileName
protected void setProfileName(java.lang.String s)
-
getProfileName
public java.lang.String getProfileName()
- Specified by:
getProfileName
in interfaceTranscodeFile
-
setCopyToFolderOverride
protected void setCopyToFolderOverride(java.lang.String s)
-
getCopyToFolderOverride
public java.lang.String getCopyToFolderOverride()
-
update
protected void update(TranscodeProviderAnalysis analysis) throws TranscodeException
- Throws:
TranscodeException
-
setResolution
protected void setResolution(int video_width, int video_height)
-
getDurationMillis
public long getDurationMillis()
- Specified by:
getDurationMillis
in interfaceTranscodeFile
-
getVideoWidth
public long getVideoWidth()
- Specified by:
getVideoWidth
in interfaceTranscodeFile
-
getVideoHeight
public long getVideoHeight()
- Specified by:
getVideoHeight
in interfaceTranscodeFile
-
getEstimatedTranscodeSize
public long getEstimatedTranscodeSize()
- Specified by:
getEstimatedTranscodeSize
in interfaceTranscodeFile
-
getCategories
public java.lang.String[] getCategories()
- Specified by:
getCategories
in interfaceTranscodeFile
-
setCategories
public void setCategories(java.lang.String[] cats)
- Specified by:
setCategories
in interfaceTranscodeFile
-
getTags
public java.lang.String[] getTags(boolean localize)
- Specified by:
getTags
in interfaceTranscodeFile
-
setTags
public void setTags(java.lang.String[] tags)
- Specified by:
setTags
in interfaceTranscodeFile
-
getCreationDateMillis
public long getCreationDateMillis()
- Specified by:
getCreationDateMillis
in interfaceTranscodeFile
-
getCacheFileIfExists
public java.io.File getCacheFileIfExists()
- Specified by:
getCacheFileIfExists
in interfaceTranscodeFile
-
getStreamURL
public java.net.URL getStreamURL()
- Specified by:
getStreamURL
in interfaceTranscodeFile
-
getStreamURL
public java.net.URL getStreamURL(java.lang.String host)
- Specified by:
getStreamURL
in interfaceTranscodeFile
-
getMimeType
public java.lang.String getMimeType()
-
delete
public void delete(boolean delete_contents) throws TranscodeException
- Specified by:
delete
in interfaceTranscodeFile
- Throws:
TranscodeException
-
deleteCacheFile
protected void deleteCacheFile() throws TranscodeException
- Throws:
TranscodeException
-
isDeleted
public boolean isDeleted()
- Specified by:
isDeleted
in interfaceTranscodeFile
-
getMap
private java.util.Map<java.lang.String,?> getMap()
-
getMap
private java.util.Map<java.lang.String,?> getMap(boolean create)
-
getBoolean
protected boolean getBoolean(java.lang.String key)
-
setBoolean
protected void setBoolean(java.lang.String key, boolean b)
-
getLong
protected long getLong(java.lang.String key)
-
setLong
protected void setLong(java.lang.String key, long value)
-
getString
protected java.lang.String getString(java.lang.String key)
-
setString
protected void setString(java.lang.String key, java.lang.String value)
-
setTransientProperty
public void setTransientProperty(java.lang.Object key2, java.lang.Object value)
- Specified by:
setTransientProperty
in interfaceTranscodeFile
-
getTransientProperty
public java.lang.Object getTransientProperty(java.lang.Object key2)
- Specified by:
getTransientProperty
in interfaceTranscodeFile
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getString
protected java.lang.String getString()
-
setCopyingToDevice
public void setCopyingToDevice(boolean b)
-
isCopyingToDevice
public boolean isCopyingToDevice()
- Specified by:
isCopyingToDevice
in interfaceTranscodeFile
-
-