Export a number of APIs.
[SquirrelJME.git] / modules / common-vm / src / main / java / cc / squirreljme / vm / VMClassLibrary.java
blob660f28c0e2b69c3d7e6475503a2e994148a0ae6b
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.vm;
12 import cc.squirreljme.runtime.cldc.annotation.Exported;
13 import java.io.IOException;
14 import java.io.InputStream;
15 import java.nio.file.Path;
17 /**
18 * This class represents a class library which represents a single JAR file
19 * whether it exists on the disk or is virtually provided.
21 * @since 2018/09/13
23 @Exported
24 public interface VMClassLibrary
26 /**
27 * Lists the names of the resources in this library.
29 * @return The resource names.
30 * @since 2019/04/21
32 @Exported
33 String[] listResources();
35 /**
36 * Returns the name of this library.
38 * @return The library name.
39 * @since 2018/09/13
41 @Exported
42 String name();
44 /**
45 * Returns the file system path if it is known and valid.
47 * @return The file system path this uses on the disk, this will be
48 * {@code null} if not valid.
49 * @since 2021/06/13
51 @Exported
52 Path path();
54 /**
55 * Opens the specified resource as a stream.
57 * @param __rc The name of the resource to open.
58 * @return The stream to the resource data or {@code null} if it is not
59 * valid.
60 * @throws IOException On read errors.
61 * @throws NullPointerException On null arguments.
62 * @since 2018/09/13
64 @Exported
65 InputStream resourceAsStream(String __rc)
66 throws IOException, NullPointerException;