Class Scorm12File
java.lang.Object
dev.jcputney.elearning.parser.input.scorm12.ims.cp.Scorm12File
- All Implemented Interfaces:
Serializable
Represents a file within SCORM 1.2 resource.
The File element is used to reference physical files that are part of a
resource. Each file can also contain metadata providing additional descriptive information.
Schema Snippet:
<xsd:element name="file">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="metadata" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="href" type="xsd:anyURI" use="required"/>
</xsd:complexType>
</xsd:element>
Example Usage in imsmanifest.xml:
<file href="index.html">
<metadata>
<schema>ADL SCORM</schema>
<schemaversion>1.2</schemaversion>
</metadata>
</file>
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetHref()Retrieves the relative path or URI of the file within the SCORM package.Retrieves the SCORM 1.2 metadata associated with this file.inthashCode()booleanisExists()Checks whether the file exists within the context of the SCORM package.voidsetExists(boolean exists) Sets the existence status of the file within the context of the SCORM 1.2 package.voidSets the relative path or URI of the file within the SCORM package.voidsetMetadata(Scorm12Metadata metadata) Assigns the SCORM 1.2 metadata to the file.
-
Constructor Details
-
Scorm12File
public Scorm12File()Default constructor for the Scorm12File class.This constructor initializes a new instance of the Scorm12File class without setting any initial values for its fields. All properties of the instance will need to be explicitly set after construction.
-
-
Method Details
-
getHref
Retrieves the relative path or URI of the file within the SCORM package.- Returns:
- A string representing the file's relative path or URI.
-
setHref
Sets the relative path or URI of the file within the SCORM package.- Parameters:
href- A string representing the file's relative path or URI. This typically has to conform to a valid URI format and specifies the location of the file in the context of the SCORM resource.
-
getMetadata
Retrieves the SCORM 1.2 metadata associated with this file.- Returns:
- An instance of
Scorm12Metadatarepresenting the metadata of the file.
-
setMetadata
Assigns the SCORM 1.2 metadata to the file.- Parameters:
metadata- An instance ofScorm12Metadatarepresenting the metadata to be associated with this file.
-
isExists
public boolean isExists()Checks whether the file exists within the context of the SCORM package.- Returns:
- A boolean value indicating whether the file exists. Returns true if the file exists, otherwise false.
-
setExists
public void setExists(boolean exists) Sets the existence status of the file within the context of the SCORM 1.2 package.- Parameters:
exists- A boolean value indicating whether the file exists. Set to true if the file exists, otherwise false.
-
equals
-
hashCode
public int hashCode()
-