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 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 Map attributes
change_listeners
protected List change_listeners
deletion_listeners
protected List deletion_listeners
ShareResourceImpl
protected ShareResourceImpl(ShareManagerImpl _manager,
int _type)
ShareResourceImpl
protected ShareResourceImpl(ShareManagerImpl _manager,
int _type,
Map _map)
serialiseResource
protected void serialiseResource(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,
String value)
- Specified by:
setAttribute
in interface ShareResource
getAttribute
public 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(File file)
throws ShareException
- Throws:
ShareException
getFingerPrintSupport
protected void getFingerPrintSupport(StringBuffer buffer,
File file,
Set ignore_set)
throws ShareException
- Throws:
ShareException
getNewTorrentLocation
protected 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 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