Class ShareResourceFileOrDirImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.sharing.ShareResourceImpl
-
- com.biglybt.pifimpl.local.sharing.ShareResourceFileOrDirImpl
-
- All Implemented Interfaces:
ShareResource
- Direct Known Subclasses:
ShareResourceDirImpl
,ShareResourceFileImpl
public abstract class ShareResourceFileOrDirImpl extends ShareResourceImpl
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
file
private ShareItemImpl
item
private byte[]
personal_key
private java.util.Map<java.lang.String,java.lang.String>
properties
-
Fields inherited from class com.biglybt.pifimpl.local.sharing.ShareResourceImpl
attributes, change_listeners, deletion_listeners, hasher, manager, parent, type
-
Fields inherited from interface com.biglybt.pif.sharing.ShareResource
ST_DIR, ST_DIR_CONTENTS, ST_FILE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ShareResourceFileOrDirImpl(ShareManagerImpl _manager, int _type, java.io.File _file, java.util.Map _map)
protected
ShareResourceFileOrDirImpl(ShareManagerImpl _manager, ShareResourceDirContentsImpl _parent, int _type, java.io.File _file, boolean _personal, java.util.Map<java.lang.String,java.lang.String> _properties)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canBeDeleted()
protected void
checkConsistency()
protected void
createTorrent()
protected void
deleteInternal()
protected static ShareResourceImpl
deserialiseResource(ShareManagerImpl manager, java.util.Map map, int type)
java.io.File
getFile()
protected abstract byte[]
getFingerPrint()
ShareItem
getItem()
java.lang.String
getName()
java.util.Map<java.lang.String,java.lang.String>
getProperties()
protected static ShareResourceImpl
getResourceSupport(ShareManagerImpl _manager, java.io.File _file)
protected void
serialiseResource(java.util.Map map)
void
setProperties(java.util.Map<java.lang.String,java.lang.String> props, boolean internal)
-
Methods inherited from class com.biglybt.pifimpl.local.sharing.ShareResourceImpl
addChangeListener, addDeletionListener, delete, delete, delete, deleteTorrent, fireChangeEvent, getAttribute, getAttributes, getChildren, getFingerPrint, getFingerPrintSupport, getNewTorrentLocation, getParent, getTorrentFile, getType, inheritAttributes, isDeleted, isPersistent, readTorrent, removeChangeListener, removeDeletionListener, setAttribute, setParent, writeTorrent
-
-
-
-
Field Detail
-
file
private final java.io.File file
-
personal_key
private final byte[] personal_key
-
properties
private final java.util.Map<java.lang.String,java.lang.String> properties
-
item
private ShareItemImpl item
-
-
Constructor Detail
-
ShareResourceFileOrDirImpl
protected ShareResourceFileOrDirImpl(ShareManagerImpl _manager, ShareResourceDirContentsImpl _parent, int _type, java.io.File _file, boolean _personal, java.util.Map<java.lang.String,java.lang.String> _properties) throws ShareException
- Throws:
ShareException
-
ShareResourceFileOrDirImpl
protected ShareResourceFileOrDirImpl(ShareManagerImpl _manager, int _type, java.io.File _file, java.util.Map _map)
-
-
Method Detail
-
getResourceSupport
protected static ShareResourceImpl getResourceSupport(ShareManagerImpl _manager, java.io.File _file) throws ShareException
- Throws:
ShareException
-
canBeDeleted
public boolean canBeDeleted() throws ShareResourceDeletionVetoException
- Specified by:
canBeDeleted
in interfaceShareResource
- Specified by:
canBeDeleted
in classShareResourceImpl
- Throws:
ShareResourceDeletionVetoException
-
getFingerPrint
protected abstract byte[] getFingerPrint() throws ShareException
- Throws:
ShareException
-
createTorrent
protected void createTorrent() throws ShareException
- Throws:
ShareException
-
checkConsistency
protected void checkConsistency() throws ShareException
- Specified by:
checkConsistency
in classShareResourceImpl
- Throws:
ShareException
-
deserialiseResource
protected static ShareResourceImpl deserialiseResource(ShareManagerImpl manager, java.util.Map map, int type) throws ShareException
- Throws:
ShareException
-
serialiseResource
protected void serialiseResource(java.util.Map map)
- Overrides:
serialiseResource
in classShareResourceImpl
-
deleteInternal
protected void deleteInternal()
- Overrides:
deleteInternal
in classShareResourceImpl
-
getName
public java.lang.String getName()
-
getFile
public java.io.File getFile()
-
getItem
public ShareItem getItem()
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> props, boolean internal)
-
-