Qwylt

java.lang.module
Class ModuleResources

java.lang.Object
  extended by java.lang.module.ModuleResources

public abstract class ModuleResources
extends java.lang.Object

This class is an accessor for the resource data contained in a ModuleArchive.

Since:
Dec 30, 2008
Author:
Bryan Atsatt

Constructor Summary
ModuleResources()
           
 
Method Summary
abstract  boolean contains(java.lang.String relativePath)
          Check if the specified resource is available from this instance.
abstract  ModuleArchive getArchive()
          Returns the archive that owns this instance.
abstract  java.net.URL getLocation()
          Returns the location of this instance.
abstract  java.util.jar.Manifest getManifest()
          Returns the manifest or null if none.
abstract  java.io.File getNativeLibrary(java.lang.String libraryName)
          Returns a File referencing the specified native library or null if not found.
abstract  java.security.ProtectionDomain getProtectionDomain(java.lang.ClassLoader loader)
          Returns the ProtectionDomain for this instance and the specified loader.
abstract  java.net.URL getResource(java.lang.String relativePath)
          Returns the specified resource or null if not found.
abstract  java.nio.ByteBuffer getResourceData(java.lang.String relativePath)
          Returns the data for the specified resource or null if not found.
abstract  java.util.Set<java.lang.String> getResourcePaths()
          Returns an unmodifiable set of paths to all contained resources.
abstract  long getStorageSize()
          Returns the storage size of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleResources

public ModuleResources()
Method Detail

getArchive

public abstract ModuleArchive getArchive()
Returns the archive that owns this instance.

Returns:
The archive.

getLocation

public abstract java.net.URL getLocation()
Returns the location of this instance.

Returns:
The location.

contains

public abstract boolean contains(java.lang.String relativePath)
Check if the specified resource is available from this instance.

Parameters:
relativePath - The relative path to the resource, which must use '/' as the path separator and must not have '/' as the first character.
Returns:
true if the specified resource is available; otherwise, return false.

getResourcePaths

public abstract java.util.Set<java.lang.String> getResourcePaths()
Returns an unmodifiable set of paths to all contained resources.

Returns:
An unmodifiable set of all resource paths. Each returned path will have '/' as the path separator and will not have '/' as the first character.

getResourceData

public abstract java.nio.ByteBuffer getResourceData(java.lang.String relativePath)
Returns the data for the specified resource or null if not found.

Parameters:
relativePath - The relative path to the resource, which must use '/' as the path separator and must not have '/' as the first character.
Returns:
A read-only buffer or null if the resource is not contained in this instance.

getResource

public abstract java.net.URL getResource(java.lang.String relativePath)
Returns the specified resource or null if not found.

Parameters:
relativePath - The relative path to the resource, which must use '/' as the path separator and must not have '/' as the first character.
Returns:
The resource or null if the resource is not contained in this instance.

getNativeLibrary

public abstract java.io.File getNativeLibrary(java.lang.String libraryName)
Returns a File referencing the specified native library or null if not found.

Parameters:
libraryName - The native library name.
Returns:
The file referencing the native library or null if the library is not contained in this instance.

getManifest

public abstract java.util.jar.Manifest getManifest()
Returns the manifest or null if none.

Returns:
the manifest or null if none.

getProtectionDomain

public abstract java.security.ProtectionDomain getProtectionDomain(java.lang.ClassLoader loader)
Returns the ProtectionDomain for this instance and the specified loader.

Parameters:
loader - The loader instance, which must be a constant for any given ModuleResources instance.
Returns:
The ProtectionDomain.

getStorageSize

public abstract long getStorageSize()
Returns the storage size of this instance.

Returns:
The size.

Qwylt

Send comments or questions to Bryan Atsatt