Class FileURIId

java.lang.Object
net.okapia.osid.primordium.id.spi.AbstractId
net.okapia.osid.primordium.id.FileURIId
All Implemented Interfaces:
Serializable, Id, OsidPrimitive, Id, OsidPrimitive

public final class FileURIId extends AbstractId implements Id
Defines an Id using a file based URI scheme for local identifiers.
See Also:
  • Constructor Details

    • FileURIId

      public FileURIId(String path)
      Creates a new FileURIId for localhost from an absolute path name.
      Parameters:
      path - the path
      Throws:
      NullArgumentException - null argument provided
  • Method Details

    • valueOf

      public static Id valueOf(String path)
      Returns an Id from an absolute path name.
      Parameters:
      path - the absolute path to include as the identifier
      Returns:
      an Id with the string components
      Throws:
      NullArgumentException - path is null
      See Also:
    • valueOf

      public static Id valueOf(URI uri)
      Returns an Id from a file based URI.
      Parameters:
      uri - the URI
      Returns:
      an Id with the string components
      Throws:
      InvalidArgumentException - cannot parse file uri because uri protocol is not file or host is not localhost
      NullArgumentException - uri is null
      See Also:
    • id

      public static Id id(String path)
      Returns an Id from an absolute path name.
      Parameters:
      path - the absolute path to include as the identifier
      Returns:
      an Id with the string components
      Throws:
      NullArgumentException - path is null
      See Also:
    • id

      public static Id id(URI uri)
      Returns an Id from a file based URI.
      Parameters:
      uri - the URI
      Returns:
      an Id with the string components
      Throws:
      InvalidArgumentException - cannot parse file uri because uri protocol is not file or host is not localhost
      NullArgumentException - uri is null
      See Also:
    • formatLabel

      public String formatLabel()
      Converts an OSID Id into a URI.
      Specified by:
      formatLabel in class AbstractId
      Returns:
      formatted string