A file packaged within a module. A Resource may be obtained by calling Module.resourceByPath(). For example:

Module mod = `module com.redhat.example`;
assert (exists resource 
   = mod.resourceByPath("com/redhat/example/file.txt"));
print(resource.textContent());
By: Enrique Zamudio

no type hierarchy

no supertypes hierarchy

no subtypes hierarchy

Attributes
nameSource Codeshared default String name

The name of the resource; usually the filename.

sizeSource Codeshared formal Integer size

The size of the resource, in bytes.

stringSource Codeshared actual String string

A developer-friendly string representing the instance. Concatenates the name of the concrete class of the instance with the hash of the instance. Subclasses are encouraged to refine this implementation to produce a more meaningful representation.

uriSource Codeshared formal String uri

The full path to the resource, expressed as a URI. For a resource packaged within a module archive, this includes both the path to the module archive file, and the path of the resource within the module archive.

Inherited Attributes
Attributes inherited from: Object
Methods
textContentSource Codeshared formal String textContent(String encoding = ...)

Retrieves the contents of the resource as a String, using the specified encoding.

Parameters:
  • encoding = "UTF-8"
Inherited Methods
Methods inherited from: Object