Class LoadedNetworkLibrary
java.lang.Object
i5.las2peer.classLoaders.libraries.LoadedLibrary
i5.las2peer.classLoaders.libraries.LoadedNetworkLibrary
- All Implemented Interfaces:
XmlAble
This class is stored in the network and represents a network library.
-
Constructor Summary
ConstructorDescriptionLoadedNetworkLibrary
(PastryNodeImpl node, LibraryIdentifier lib, Map<String, byte[]> dependencies) -
Method Summary
Modifier and TypeMethodDescriptionstatic LoadedNetworkLibrary
createFromXml
(PastryNodeImpl node, String xmlStr) byte[]
getResourceAsBinary
(String resourceName) get the contents of a resource as a byte arraygetResourceAsUrl
(String resourceName) for class and resource loading: get the URL for the specified resourceReturns 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, Map<String, byte[]> dependencies)
-
-
Method Details
-
getResourceAsUrl
Description copied from class:LoadedLibrary
for class and resource loading: get the URL for the specified resource- Specified by:
getResourceAsUrl
in 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(String resourceName) throws IOException, ResourceNotFoundException Description copied from class:LoadedLibrary
get the contents of a resource as a byte array- Overrides:
getResourceAsBinary
in classLoadedLibrary
- Parameters:
resourceName
- A resource name- Returns:
- contents of the requested resource
- Throws:
IOException
- If the resource could not be readResourceNotFoundException
- the given resource does not exists in this library
-
toXmlString
Description copied from interface:XmlAble
Returns a XML representation of this object.- Specified by:
toXmlString
in interfaceXmlAble
- Returns:
- a XML String representation
- Throws:
SerializationException
-
createFromXml
public static LoadedNetworkLibrary createFromXml(PastryNodeImpl node, String xmlStr) throws MalformedXMLException - Throws:
MalformedXMLException
-