org.gudy.azureus2.pluginsimpl.local.sharing
Class ShareResourceImpl
java.lang.Object
org.gudy.azureus2.pluginsimpl.local.sharing.ShareResourceImpl
- All Implemented Interfaces:
- ShareResource
- Direct Known Subclasses:
- ShareResourceDirContentsImpl, ShareResourceFileOrDirImpl
public abstract class ShareResourceImpl
- extends java.lang.Object
- implements ShareResource
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
hasher
protected static BrokenMd5Hasher hasher
manager
protected ShareManagerImpl manager
type
protected int type
parent
protected ShareResourceDirContents parent
attributes
protected java.util.Map attributes
change_listeners
protected java.util.List change_listeners
deletion_listeners
protected java.util.List deletion_listeners
ShareResourceImpl
protected ShareResourceImpl(ShareManagerImpl _manager,
int _type)
ShareResourceImpl
protected ShareResourceImpl(ShareManagerImpl _manager,
int _type,
java.util.Map _map)
serialiseResource
protected void serialiseResource(java.util.Map map)
getParent
public ShareResourceDirContents getParent()
- Specified by:
getParent
in interface ShareResource
setParent
protected void setParent(ShareResourceDirContents _parent)
getChildren
public ShareResource[] getChildren()
getType
public int getType()
- Specified by:
getType
in interface ShareResource
setAttribute
public void setAttribute(TorrentAttribute attribute,
java.lang.String value)
- Specified by:
setAttribute
in interface ShareResource
getAttribute
public java.lang.String getAttribute(TorrentAttribute attribute)
- Specified by:
getAttribute
in interface ShareResource
- Returns:
- null if no value defined
getAttributes
public TorrentAttribute[] getAttributes()
- Description copied from interface:
ShareResource
- get the defined attributes for this resource
- Specified by:
getAttributes
in interface ShareResource
- Returns:
inheritAttributes
protected void inheritAttributes(ShareResourceImpl source)
delete
public void delete()
throws ShareException,
ShareResourceDeletionVetoException
- Specified by:
delete
in interface ShareResource
- Throws:
ShareException
ShareResourceDeletionVetoException
delete
public void delete(boolean force)
throws ShareException,
ShareResourceDeletionVetoException
- Specified by:
delete
in interface ShareResource
- Throws:
ShareException
ShareResourceDeletionVetoException
delete
public void delete(boolean force,
boolean fire_listeners)
throws ShareException,
ShareResourceDeletionVetoException
- Throws:
ShareException
ShareResourceDeletionVetoException
canBeDeleted
public abstract boolean canBeDeleted()
throws ShareResourceDeletionVetoException
- Specified by:
canBeDeleted
in interface ShareResource
- Throws:
ShareResourceDeletionVetoException
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in interface ShareResource
deleteInternal
protected abstract void deleteInternal()
getFingerPrint
protected byte[] getFingerPrint(java.io.File file)
throws ShareException
- Throws:
ShareException
getFingerPrintSupport
protected void getFingerPrintSupport(java.lang.StringBuffer buffer,
java.io.File file,
java.util.Set ignore_set)
throws ShareException
- Throws:
ShareException
getNewTorrentLocation
protected java.lang.String getNewTorrentLocation()
throws ShareException
- Throws:
ShareException
writeTorrent
protected void writeTorrent(ShareItemImpl item)
throws ShareException
- Throws:
ShareException
readTorrent
protected void readTorrent(ShareItemImpl item)
throws ShareException
- Throws:
ShareException
deleteTorrent
protected void deleteTorrent(ShareItemImpl item)
getTorrentFile
public java.io.File getTorrentFile(ShareItemImpl item)
checkConsistency
protected abstract void checkConsistency()
throws ShareException
- Throws:
ShareException
addChangeListener
public void addChangeListener(ShareResourceListener l)
- Specified by:
addChangeListener
in interface ShareResource
removeChangeListener
public void removeChangeListener(ShareResourceListener l)
- Specified by:
removeChangeListener
in interface ShareResource
addDeletionListener
public void addDeletionListener(ShareResourceWillBeDeletedListener l)
- Specified by:
addDeletionListener
in interface ShareResource
removeDeletionListener
public void removeDeletionListener(ShareResourceWillBeDeletedListener l)
- Specified by:
removeDeletionListener
in interface ShareResource