java.lang.Object
dev.jcputney.elearning.parser.input.scorm12.ims.cp.Scorm12File
All Implemented Interfaces:
Serializable

public final class Scorm12File extends Object implements 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
    Constructor
    Description
    Default constructor for the Scorm12File class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Retrieves the relative path or URI of the file within the SCORM package.
    Retrieves the SCORM 1.2 metadata associated with this file.
    int
     
    boolean
    Checks whether the file exists within the context of the SCORM package.
    void
    setExists(boolean exists)
    Sets the existence status of the file within the context of the SCORM 1.2 package.
    void
    Sets the relative path or URI of the file within the SCORM package.
    void
    Assigns the SCORM 1.2 metadata to the file.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • 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

      public String 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

      public void setHref(String href)
      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

      public Scorm12Metadata getMetadata()
      Retrieves the SCORM 1.2 metadata associated with this file.
      Returns:
      An instance of Scorm12Metadata representing the metadata of the file.
    • setMetadata

      public void setMetadata(Scorm12Metadata metadata)
      Assigns the SCORM 1.2 metadata to the file.
      Parameters:
      metadata - An instance of Scorm12Metadata representing 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object