Class FileURNFactory

  • All Implemented Interfaces:
    IURNProvider

    public final class FileURNFactory
    extends java.lang.Object
    implements IURNProvider
    The File URN provider depends on the URNResourceType and an identifier, where the identifier is either a String for URNResourceType.

    File URN's are encoded in iizi as:

    urn:iz-file:type/identifier

    where the valid {code type}s are (in lower case):

    • {@link URNResourceType#COMMON_DATABASE_PERSISTENT}: Common server files stored in database (cached on the server even for starts/stops),
    • {@link URNResourceType#COMMON_PERSISTENT}: Common server files (persists when server starts/stops),
    • {@link URNResourceType#COMMON_VOLATILE}: Common server files (volatile when server starts/stops),
    • {@link URNResourceType#EXTERNAL_FILES}: External files (typically accessible using the 'file:' protocol),
    • {@link URNResourceType#APPLICATION_DATABASE_PERSISTENT}: Application files in database,
    • {@link URNResourceType#APPLICATION_PERSISTENT}: Application files,
    • {@link URNResourceType#APPLICATION_VOLATILE}: Application files,
    • {@link URNResourceType#GROUP_DATABASE_FILES}: Private user group files stored in database (cached on server),
    • {@link URNResourceType#USER_FILES}: Private user files,
    • {@link URNResourceType#USER_DATABASE_FILES}: Private user files stored in database (cached on server),
    • {@link URNResourceType#APP_SESSION}: Application session files,
    • {@link URNResourceType#CLIENT_SESSION}: Client session files.
    Author:
    Christopher Mindus
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FileURNFactory getInstance()
      Gets the singleton instance of the File URN factory.
      NID getNID()
      Gets the Naming IDentifier of the provider.
      java.util.List<URNResourceType> getResourceTypes()
      Gets the URN Resource Type supported by the provider.
      static void initialize​(URNFactory factory)
      Initializes the File URN factory.
      FileURN parse​(java.lang.String urnString, java.lang.String nss, java.lang.String req, java.lang.String query, java.lang.String fragment)
      Parses the URN after the NID specification, i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • initialize

        public static void initialize​(URNFactory factory)
        Initializes the File URN factory.
        Parameters:
        factory - The main URN factory.
      • getInstance

        public static FileURNFactory getInstance()
        Gets the singleton instance of the File URN factory.
        Returns:
        The URL URN factory instance, or null if not yet initialized.
      • getResourceTypes

        public java.util.List<URNResourceType> getResourceTypes()
        Gets the URN Resource Type supported by the provider.
        Specified by:
        getResourceTypes in interface IURNProvider
        Returns:
        The supported resource type, empty list when not resource based.
      • getNID

        public NID getNID()
        Gets the Naming IDentifier of the provider.
        Specified by:
        getNID in interface IURNProvider
        Returns:
        The NID.FILE.
      • parse

        public FileURN parse​(java.lang.String urnString,
                             java.lang.String nss,
                             java.lang.String req,
                             java.lang.String query,
                             java.lang.String fragment)
                      throws URNException
        Parses the URN after the NID specification, i.e. after "urn:NID:".
        Specified by:
        parse in interface IURNProvider
        Parameters:
        urnString - The full unparsed original URN string.
        nss - The NSS part of the string (before request/query/fragment).
        req - The decoded request String (without "?+"), null for none.
        query - The decoded query String (without "?="), null for none.
        fragment - The decoded fragment, null for none.
        Returns:
        The URN instance.
        Throws:
        URNException - For URN exceptions.
        java.lang.IllegalArgumentException - If the "NSS" part of the string is not a valid type, followed by a valid ID.