Class LoadedNetworkLibrary
java.lang.Object
i5.las2peer.classLoaders.libraries.LoadedLibrary
i5.las2peer.classLoaders.libraries.LoadedNetworkLibrary
- All Implemented Interfaces:
XmlAble
public class LoadedNetworkLibrary extends LoadedLibrary implements XmlAble
This class is stored in the network and represents a network library.
-
Constructor Summary
Constructors Constructor Description LoadedNetworkLibrary(PastryNodeImpl node, LibraryIdentifier lib, java.util.Map<java.lang.String,byte[]> dependencies) -
Method Summary
Modifier and Type Method Description static LoadedNetworkLibrarycreateFromXml(PastryNodeImpl node, java.lang.String xmlStr)byte[]getResourceAsBinary(java.lang.String resourceName)get the contents of a resource as a byte arrayjava.net.URLgetResourceAsUrl(java.lang.String resourceName)for class and resource loading: get the URL for the specified resourcejava.lang.StringtoXmlString()Returns a XML representation of this object.Methods inherited from class i5.las2peer.classLoaders.libraries.LoadedLibrary
classToResourceName, getIdentifier, getLibraryIdentifier, getResourceAsString, resourceToClassName
-
Constructor Details
-
LoadedNetworkLibrary
public LoadedNetworkLibrary(PastryNodeImpl node, LibraryIdentifier lib, java.util.Map<java.lang.String,byte[]> dependencies)
-
-
Method Details
-
getResourceAsUrl
public java.net.URL getResourceAsUrl(java.lang.String resourceName) throws ResourceNotFoundExceptionDescription copied from class:LoadedLibraryfor class and resource loading: get the URL for the specified resource- Specified by:
getResourceAsUrlin classLoadedLibrary- Parameters:
resourceName- A resource name- Returns:
- a URL for the requested resource
- Throws:
ResourceNotFoundException- the given resource does not exists in this library
-
getResourceAsBinary
public byte[] getResourceAsBinary(java.lang.String resourceName) throws java.io.IOException, ResourceNotFoundExceptionDescription copied from class:LoadedLibraryget the contents of a resource as a byte array- Overrides:
getResourceAsBinaryin classLoadedLibrary- Parameters:
resourceName- A resource name- Returns:
- contents of the requested resource
- Throws:
java.io.IOException- If the resource could not be readResourceNotFoundException- the given resource does not exists in this library
-
toXmlString
Description copied from interface:XmlAbleReturns a XML representation of this object.- Specified by:
toXmlStringin interfaceXmlAble- Returns:
- a XML String representation
- Throws:
SerializationException
-
createFromXml
public static LoadedNetworkLibrary createFromXml(PastryNodeImpl node, java.lang.String xmlStr) throws MalformedXMLException- Throws:
MalformedXMLException
-